allow easy default to absl::Hash framework

This commit is contained in:
greg
2019-03-30 14:38:38 -04:00
parent e5c4e46bd5
commit 2836a43989
2 changed files with 11 additions and 5 deletions
+9 -3
View File
@@ -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