mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 00:50:38 +08:00
Update phmap::Hash so that std::hash<Foo*> can be overridden - issue #168
This commit is contained in:
+3
-1
@@ -4426,7 +4426,9 @@ struct HashEq<T*>
|
||||
using is_transparent = void;
|
||||
template <class U>
|
||||
size_t operator()(const U& ptr) const {
|
||||
return phmap::Hash<const T*>{}(HashEq::ToPtr(ptr));
|
||||
// we want phmap::Hash<T*> and not phmap::Hash<const T*>
|
||||
// so "struct std::hash<T*> " override works
|
||||
return phmap::Hash<T*>{}((T*)(uintptr_t)HashEq::ToPtr(ptr));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user