From 4e88c80a22b6ca982341413ee806ade0df57b4b7 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 2 Nov 2017 07:05:11 -0700 Subject: RethinkDB native connector work, minor fixes. --- node/InetAddress.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'node') 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)); } -- cgit v1.2.3