From 8a118fc294d2b4d1ff174bb67da866b8d3a52a95 Mon Sep 17 00:00:00 2001 From: Sven Scharmentke Date: Thu, 11 Jul 2019 08:28:57 +0200 Subject: [PATCH] Support hashing. This enabled hashing so that unordered_map are supported. --- enum.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/enum.h b/enum.h index 3ba66b3..6618a7a 100644 --- a/enum.h +++ b/enum.h @@ -949,6 +949,16 @@ operator >>(std::basic_istream& stream, Enum &value) \ stream.setstate(std::basic_istream::failbit); \ \ return stream; \ +} \ + \ +namespace std { \ +template <> struct hash \ +{ \ + size_t operator()(const Enum &x) const \ + { \ + return std::hash()(x._to_index()); \ + } \ +}; \ }