mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-16 21:58:08 +00:00
Use MAKE_ENUM_HASHABLE to hash SymbolKind
This commit is contained in:
parent
420e84329b
commit
d79a7a3fa1
@ -36,17 +36,7 @@ struct IndexVar;
|
|||||||
// front of others.
|
// front of others.
|
||||||
enum class SymbolKind : uint8_t { Invalid, File, Type, Func, Var };
|
enum class SymbolKind : uint8_t { Invalid, File, Type, Func, Var };
|
||||||
MAKE_REFLECT_TYPE_PROXY(SymbolKind);
|
MAKE_REFLECT_TYPE_PROXY(SymbolKind);
|
||||||
|
MAKE_ENUM_HASHABLE(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
|
|
||||||
|
|
||||||
using RawId = uint32_t;
|
using RawId = uint32_t;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user