diff --git a/include/tins/ip_address.h b/include/tins/ip_address.h index e16387c..8b9b249 100644 --- a/include/tins/ip_address.h +++ b/include/tins/ip_address.h @@ -35,6 +35,7 @@ #include #include "cxxstd.h" #include "macros.h" +#include namespace Tins { /** @@ -204,8 +205,11 @@ private: namespace std { template<> -TINS_API struct hash { - size_t operator()(const Tins::IPv4Address& addr) const; +struct hash { + size_t operator()(const Tins::IPv4Address& addr) const + { + return std::hash()(addr); + } }; } // std diff --git a/include/tins/ipv6_address.h b/include/tins/ipv6_address.h index 454b9f7..aad0136 100644 --- a/include/tins/ipv6_address.h +++ b/include/tins/ipv6_address.h @@ -35,6 +35,7 @@ #include #include "cxxstd.h" #include "macros.h" +#include namespace Tins { @@ -222,8 +223,11 @@ private: namespace std { template<> -TINS_API struct hash { - size_t operator()(const Tins::IPv6Address& addr) const; +struct hash { + size_t operator()(const Tins::IPv6Address& addr) const + { + return std::hash()(addr.to_string()); + } }; } // std diff --git a/src/ip_address.cpp b/src/ip_address.cpp index d6d1c95..cca9af4 100644 --- a/src/ip_address.cpp +++ b/src/ip_address.cpp @@ -154,13 +154,3 @@ IPv4Address IPv4Address::operator&(const IPv4Address& mask) const { } } // Tins - -#if TINS_IS_CXX11 -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 d9e5e3f..36e12c2 100644 --- a/src/ipv6_address.cpp +++ b/src/ipv6_address.cpp @@ -152,13 +152,3 @@ IPv6Address operator&(const IPv6Address& lhs, const IPv6Address& rhs) { } } // Tins - -#if TINS_IS_CXX11 -namespace std { - -size_t hash::operator()(const Tins::IPv6Address& addr) const { - return std::hash()(addr.to_string()); -} - -} // std -#endif // TINS_IS_CXX11