From 1f57c76036c4748b75b4e9ca07be6f3274c1d1ab Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 12 Jul 2025 01:28:14 +0300 Subject: [PATCH] Add std::array hash --- libs/util/include/psemek/util/hash.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libs/util/include/psemek/util/hash.hpp b/libs/util/include/psemek/util/hash.hpp index 3e53bf22..3a05a1f9 100644 --- a/libs/util/include/psemek/util/hash.hpp +++ b/libs/util/include/psemek/util/hash.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -64,6 +65,20 @@ namespace std } }; + template + struct hash> + : std::hash + { + using std::hash::operator(); + + std::uint64_t operator()(std::array const & x) const + { + std::uint64_t seed = 0; + ::psemek::util::hash_sequence(seed, x.begin(), x.end(), *this); + return seed; + } + }; + template struct hash> : std::tuple...>