For enum type, I think this is a suitable way, and the difference between class is how to calculate hash value.
template
struct EnumTypeHash {
std::size_t operator()(const T& type) const {
return static_cast(type);
}
};
enum MyEnum {};
class MyValue {};
std::unordered_map> map_;