1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fix hash<IPv4/6Address> build issues in VC

* fixed compile failure due to macro

* add functional to cxxstd.h to try to fix mac

* clang bug identified, moving functional include to later

* last step, move hash def to header

* avoid allocation on hash

* set ipv6 back to string hash
This commit is contained in:
solvingj
2017-09-19 22:00:28 -04:00
committed by Matias Fontanini
parent e48f64daac
commit a7dd867503
4 changed files with 12 additions and 24 deletions

View File

@@ -35,6 +35,7 @@
#include <stdint.h>
#include "cxxstd.h"
#include "macros.h"
#include <functional>
namespace Tins {
/**
@@ -204,8 +205,11 @@ private:
namespace std {
template<>
TINS_API struct hash<Tins::IPv4Address> {
size_t operator()(const Tins::IPv4Address& addr) const;
struct hash<Tins::IPv4Address> {
size_t operator()(const Tins::IPv4Address& addr) const
{
return std::hash<std::uint32_t>()(addr);
}
};
} // std