R-Type  2
Doom but in better
Loading...
Searching...
No Matches
asio_hash.hpp
Go to the documentation of this file.
1#ifndef ASIO_HASH_HPP
2#define ASIO_HASH_HPP
3
4#include <asio.hpp>
5#include <functional>
12namespace std {
13 template<>
14 struct hash<asio::ip::udp::endpoint> {
15 std::size_t operator()(const asio::ip::udp::endpoint& endpoint) const noexcept {
16 auto addressHash = std::hash<std::string>()(endpoint.address().to_string());
17 auto portHash = std::hash<unsigned short>()(endpoint.port());
18 return addressHash ^ (portHash << 1);
19 }
20 };
21}
22
23#endif // ASIO_HASH_HPP
std::size_t operator()(const asio::ip::udp::endpoint &endpoint) const noexcept
Definition asio_hash.hpp:15