32 #include <unordered_map>
43 return (
size_t)(addr.sin_addr.s_addr ^ addr.sin_port);
50 return (addr1.sin_addr.s_addr == addr2.sin_addr.s_addr)
51 && (addr1.sin_port == addr2.sin_port);
56 template<
typename TypeT,
typename addr = InetAddr>
57 class SockAddrMap :
public std::unordered_map<addr, TypeT, SockAddrHash, SockAddrEqual> {
64 #endif // SOCKADDRMAP_H
Equality predicate functor class for InetAddr.
Hash functor class for InetAddr.
Unordered map specialization for InetAddr keys.
Encapsulate an internet address.
size_t operator()(const InetAddr &addr) const
Internet address wrapper classes and utility functions.
bool operator()(const InetAddr &addr1, const InetAddr &addr2) const