summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/InetAddress.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp
index c1ea6c13..76810b93 100644
--- a/node/InetAddress.hpp
+++ b/node/InetAddress.hpp
@@ -83,6 +83,13 @@ struct InetAddress : public sockaddr_storage
IP_SCOPE_PRIVATE = 7 // 10.x.x.x, 192.168.x.x, etc.
};
+ // Can be used with the unordered maps and sets in c++11. We don't use C++11 in the core
+ // but this is safe to put here.
+ struct Hasher
+ {
+ inline std::size_t operator()(const InetAddress &a) const { return (std::size_t)a.hashCode(); }
+ };
+
InetAddress() { memset(this,0,sizeof(InetAddress)); }
InetAddress(const InetAddress &a) { memcpy(this,&a,sizeof(InetAddress)); }
InetAddress(const InetAddress *a) { memcpy(this,a,sizeof(InetAddress)); }