From 283d9c519430fa3446844e6ddf7b2a77656e103e Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Thu, 14 Mar 2019 14:00:24 +0300 Subject: [PATCH] Added default enum class hasher --- base/stl_helpers.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/base/stl_helpers.hpp b/base/stl_helpers.hpp index cfd6632fc3..7257c9b836 100644 --- a/base/stl_helpers.hpp +++ b/base/stl_helpers.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -414,4 +415,13 @@ void AccumulateIntervals1With2(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, InsertIte if (validPrev) *res++ = prev; } + +struct EnumClassHash +{ + template::value> * = nullptr> + size_t operator()(T const & t) const noexcept + { + return static_cast(t); + } +}; } // namespace base