From 46d637328ad687ba5a8d98dcf9227a6dc480d9fe Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 13 Jul 2021 11:43:03 +0300 Subject: [PATCH] Add util::any_hash --- libs/util/include/psemek/util/hash.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/util/include/psemek/util/hash.hpp b/libs/util/include/psemek/util/hash.hpp index a2ae01e8..2c5dbd64 100644 --- a/libs/util/include/psemek/util/hash.hpp +++ b/libs/util/include/psemek/util/hash.hpp @@ -16,6 +16,17 @@ namespace psemek::util seed = b * k; } + struct any_hash + { + struct is_transparent{}; + + template + std::size_t operator() (T const & x) const + { + return std::hash{}(x); + } + }; + } namespace std