mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Fix build issues due to std::hash missing
This commit is contained in:
@@ -35,6 +35,10 @@
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include "cxxstd.h"
|
||||
#if TINS_IS_CXX11
|
||||
// std::hash
|
||||
#include <memory>
|
||||
#endif // TINS_IS_CXX11
|
||||
|
||||
namespace Tins {
|
||||
namespace Internals {
|
||||
|
||||
@@ -205,9 +205,7 @@ namespace std {
|
||||
|
||||
template<>
|
||||
struct hash<Tins::IPv4Address> {
|
||||
size_t operator()(const Tins::IPv4Address& addr) const {
|
||||
return std::hash<uint32_t>()(addr);
|
||||
}
|
||||
size_t operator()(const Tins::IPv4Address& addr) const;
|
||||
};
|
||||
|
||||
} // std
|
||||
|
||||
@@ -223,9 +223,7 @@ namespace std {
|
||||
|
||||
template<>
|
||||
struct hash<Tins::IPv6Address> {
|
||||
size_t operator()(const Tins::IPv6Address& addr) const {
|
||||
return std::hash<std::string>()(addr.to_string());
|
||||
}
|
||||
size_t operator()(const Tins::IPv6Address& addr) const;
|
||||
};
|
||||
|
||||
} // std
|
||||
|
||||
Reference in New Issue
Block a user