diff options
Diffstat (limited to 'include/erebos')
-rw-r--r-- | include/erebos/uuid.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/erebos/uuid.h b/include/erebos/uuid.h index e67677a..d3a3510 100644 --- a/include/erebos/uuid.h +++ b/include/erebos/uuid.h @@ -1,6 +1,7 @@ #pragma once #include <array> +#include <cstring> #include <optional> #include <string> @@ -24,3 +25,16 @@ struct UUID }; } + +namespace std +{ + template<> struct hash<erebos::UUID> + { + std::size_t operator()(const erebos::UUID & uuid) const noexcept + { + std::size_t res; + std::memcpy(&res, uuid.uuid.data(), sizeof res); + return res; + } + }; +} |