Browse Source
Merge pull request #6827 from Morph1984/uuid-hash
common: uuid: Add hash function for UUID
pull/15/merge
bunnei
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
0 deletions
-
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 |