mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Try to make VC happy with std::hash definition
This commit is contained in:
@@ -157,8 +157,11 @@ IPv4Address IPv4Address::operator&(const IPv4Address& mask) const {
|
||||
} // Tins
|
||||
|
||||
#ifdef TINS_IS_CXX11
|
||||
// Hash
|
||||
size_t std::hash<Tins::IPv4Address>::operator()(const Tins::IPv4Address& addr) const {
|
||||
namespace std {
|
||||
|
||||
size_t hash<Tins::IPv4Address>::operator()(const Tins::IPv4Address& addr) const {
|
||||
return std::hash<uint32_t>()(addr);
|
||||
}
|
||||
|
||||
} // std
|
||||
#endif // TINS_IS_CXX11
|
||||
|
||||
@@ -154,8 +154,11 @@ IPv6Address operator&(const IPv6Address& lhs, const IPv6Address& rhs) {
|
||||
} // Tins
|
||||
|
||||
#ifdef TINS_IS_CXX11
|
||||
// Hash
|
||||
size_t std::hash<Tins::IPv6Address>::operator()(const Tins::IPv6Address& addr) const {
|
||||
namespace std {
|
||||
|
||||
size_t hash<Tins::IPv6Address>::operator()(const Tins::IPv6Address& addr) const {
|
||||
return std::hash<string>()(addr.to_string());
|
||||
}
|
||||
|
||||
} // std
|
||||
#endif // TINS_IS_CXX11
|
||||
|
||||
Reference in New Issue
Block a user