Loading .gitignore +2 −1 Original line number Diff line number Diff line Loading @@ -21,3 +21,4 @@ *.user *.userosscache *.sln.ide src/uuidp.h +16 −0 Original line number Diff line number Diff line Loading @@ -67,8 +67,24 @@ namespace uuid{ bool operator<(const uuid& other) const; uuid_t value; size_t hash() const noexcept { size_t h = 0; for (int i = 0; i < 16; ++i) h = h * 131 + value[i]; return h; } private: char *cstr; }; }; namespace std { template<> struct hash<uuid::uuid> { size_t operator()(const uuid::uuid &u) const noexcept { return u.hash(); } }; }; Loading
.gitignore +2 −1 Original line number Diff line number Diff line Loading @@ -21,3 +21,4 @@ *.user *.userosscache *.sln.ide
src/uuidp.h +16 −0 Original line number Diff line number Diff line Loading @@ -67,8 +67,24 @@ namespace uuid{ bool operator<(const uuid& other) const; uuid_t value; size_t hash() const noexcept { size_t h = 0; for (int i = 0; i < 16; ++i) h = h * 131 + value[i]; return h; } private: char *cstr; }; }; namespace std { template<> struct hash<uuid::uuid> { size_t operator()(const uuid::uuid &u) const noexcept { return u.hash(); } }; };