Use MAKE_ENUM_HASHABLE to hash SymbolKind

This commit is contained in:
Manny Schneck 2018-02-10 19:36:40 -06:00 committed by scturtle
parent 420e84329b
commit d79a7a3fa1

View File

@ -36,17 +36,7 @@ struct IndexVar;
// front of others.
enum class SymbolKind : uint8_t { Invalid, File, Type, Func, Var };
MAKE_REFLECT_TYPE_PROXY(SymbolKind);
// FIXME: Make old compiler happy.
namespace std {
template <>
struct hash<::SymbolKind> {
size_t operator()(const ::SymbolKind& instance) const {
using type = std::underlying_type<::SymbolKind>::type;
return std::hash<type>()(static_cast<type>(instance));
}
};
} // namespace std
MAKE_ENUM_HASHABLE(SymbolKind);
using RawId = uint32_t;