Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

common: uuid: Add hash function for UUID

Morph93697805a79f
diff --git a/src/common/uuid.h b/src/common/uuid.h
index aeb36939a3..2353179d87 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