17#ifndef _FGE_C_IDENTITY_HPP_INCLUDED
18#define _FGE_C_IDENTITY_HPP_INCLUDED
20#include "C_ipAddress.hpp"
35 inline bool operator==(
Identity const& right)
const
37 return (this->_ip == right._ip) && (this->_port == right._port);
48 inline std::size_t operator()(
Identity const&
id)
const
50 auto const h1 = std::hash<IpAddress>{}(
id._ip);
51 auto const h2 = std::hash<Port>{}(
id._port);
52 return h1 ^ (h2 << 1);
A class to represent an IP address.
Definition C_ipAddress.hpp:57
A class to hash an Identity (useful for std::unordered_map or other containers)
Definition C_identity.hpp:47
A class to represent a client or server identity with an IP address and a port.
Definition C_identity.hpp:31