diff --git a/src/ip_address.cpp b/src/ip_address.cpp index e2e892a..1d55c45 100644 --- a/src/ip_address.cpp +++ b/src/ip_address.cpp @@ -157,8 +157,11 @@ IPv4Address IPv4Address::operator&(const IPv4Address& mask) const { } // Tins #ifdef TINS_IS_CXX11 -// Hash -size_t std::hash::operator()(const Tins::IPv4Address& addr) const { +namespace std { + +size_t hash::operator()(const Tins::IPv4Address& addr) const { return std::hash()(addr); } + +} // std #endif // TINS_IS_CXX11 diff --git a/src/ipv6_address.cpp b/src/ipv6_address.cpp index 9a3ab79..6523cc5 100644 --- a/src/ipv6_address.cpp +++ b/src/ipv6_address.cpp @@ -154,8 +154,11 @@ IPv6Address operator&(const IPv6Address& lhs, const IPv6Address& rhs) { } // Tins #ifdef TINS_IS_CXX11 -// Hash -size_t std::hash::operator()(const Tins::IPv6Address& addr) const { +namespace std { + +size_t hash::operator()(const Tins::IPv6Address& addr) const { return std::hash()(addr.to_string()); } + +} // std #endif // TINS_IS_CXX11