diff options
author | bunnei <bunneidev@gmail.com> | 2021-08-07 17:18:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-07 17:18:46 -0700 |
commit | 63325cafbe44cfa592fb03b0d68af1cf4a792c5b (patch) | |
tree | 88de695ab886ede9046edd7c9f9d0cbb1129d3c3 /src | |
parent | bd0e1d3a2561c3580f3d6706800493a347ad6be2 (diff) | |
parent | d20c5ac720a0d26457c070b6d135c780af73107a (diff) |
Merge pull request #6827 from Morph1984/uuid-hash
common: uuid: Add hash function for UUID
Diffstat (limited to 'src')
-rw-r--r-- | src/common/uuid.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/uuid.h b/src/common/uuid.h index aeb36939a..2353179d8 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h @@ -69,3 +69,14 @@ struct UUID { static_assert(sizeof(UUID) == 16, "UUID is an invalid size!"); } // namespace Common + +namespace std { + +template <> +struct hash<Common::UUID> { + size_t operator()(const Common::UUID& uuid) const noexcept { + return uuid.uuid[1] ^ uuid.uuid[0]; + } +}; + +} // namespace std |