mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-29 08:34:39 +08:00
allow easy default to absl::Hash framework
This commit is contained in:
Vendored
+9
-3
@@ -24,11 +24,15 @@ namespace phmap {
|
||||
template <class T, class E = void>
|
||||
struct HashEq
|
||||
{
|
||||
#ifdef PHMAP_USE_ABSL_HASHEQ
|
||||
using Hash = absl::Hash<T>;
|
||||
using Eq = absl::EqualTo<T>;
|
||||
#else
|
||||
using Hash = phmap::Hash<T>;
|
||||
using Eq = phmap::EqualTo<T>;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
using hash_default_hash = typename container_internal::HashEq<T>::Hash;
|
||||
|
||||
@@ -36,10 +40,12 @@ namespace phmap {
|
||||
using hash_default_eq = typename container_internal::HashEq<T>::Eq;
|
||||
|
||||
// type alias for std::allocator so we can forward declare without including other headers
|
||||
template <class T> using Allocator = typename phmap::Allocator<T>;
|
||||
template <class T>
|
||||
using Allocator = typename phmap::Allocator<T>;
|
||||
|
||||
// type alias for std::pair so we can forward declare without including other headers
|
||||
template<class T1, class T2> using Pair = typename phmap::Pair<T1, T2>;
|
||||
template<class T1, class T2>
|
||||
using Pair = typename phmap::Pair<T1, T2>;
|
||||
|
||||
} // namespace container_internal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user