Support hashing.

This enabled hashing so that unordered_map are supported.
This commit is contained in:
Sven Scharmentke 2019-07-11 08:28:57 +02:00
parent 8a0d376b53
commit 8a118fc294

10
enum.h
View File

@ -949,6 +949,16 @@ operator >>(std::basic_istream<Char, Traits>& stream, Enum &value) \
stream.setstate(std::basic_istream<Char, Traits>::failbit); \
\
return stream; \
} \
\
namespace std { \
template <> struct hash<Enum> \
{ \
size_t operator()(const Enum &x) const \
{ \
return std::hash<size_t>()(x._to_index()); \
} \
}; \
}