Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
Use MAKE_ENUM_HASHABLE to hash SymbolKind
Browse files Browse the repository at this point in the history
  • Loading branch information
Manny Schneck authored and scturtle committed Feb 11, 2018
1 parent dd18dbf commit 2f24cfe
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/indexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2f24cfe

Please sign in to comment.