From 7eb067338f998e3e61cd3e8181f02c634d6ca282 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Mon, 8 May 2017 22:14:39 -0700 Subject: [PATCH] Try to make VC happy with std::hash definition --- src/ip_address.cpp | 7 +++++-- src/ipv6_address.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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