diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-11-02 07:05:11 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-11-02 07:05:11 -0700 |
commit | 4e88c80a22b6ca982341413ee806ade0df57b4b7 (patch) | |
tree | 82c2daaac597f74595bc83c18646280a56898e1a /node/InetAddress.hpp | |
parent | a6203ed0389c1b995ebe94935b2d1ddeb01f36ee (diff) | |
download | infinitytier-4e88c80a22b6ca982341413ee806ade0df57b4b7.tar.gz infinitytier-4e88c80a22b6ca982341413ee806ade0df57b4b7.zip |
RethinkDB native connector work, minor fixes.
Diffstat (limited to 'node/InetAddress.hpp')
-rw-r--r-- | node/InetAddress.hpp | 7 |
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)); } |