diff options
author | Dennis Kormalev <denk@google.com> | 2024-04-24 14:05:14 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-24 14:06:05 -0700 |
commit | 08b21bd037990c18d44fda1691211e73835bf214 (patch) | |
tree | dcc50e661487803c63501710f3cc3fd965651f43 /absl/container/node_hash_map.h | |
parent | b0160ba46be86c3728b5e72a194c34f166740af1 (diff) | |
download | abseil-08b21bd037990c18d44fda1691211e73835bf214.tar.gz abseil-08b21bd037990c18d44fda1691211e73835bf214.tar.bz2 abseil-08b21bd037990c18d44fda1691211e73835bf214.zip |
Add public aliases for default hash/eq types in hash-based containers
Generic user code sometimes wants to provide more flexibility for its
own users and provide type arguments that are used as Hash/Eq in
underlying containers.
However, there is no sensible publicly available default value for it
yet.
This CL fixes this issue and provides publicly visible aliases that such
user code can use.
PiperOrigin-RevId: 627844757
Change-Id: I4c393007244ad8d998da02883c623eae1715c0df
Diffstat (limited to 'absl/container/node_hash_map.h')
-rw-r--r-- | absl/container/node_hash_map.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/absl/container/node_hash_map.h b/absl/container/node_hash_map.h index cb41543c..31beb1da 100644 --- a/absl/container/node_hash_map.h +++ b/absl/container/node_hash_map.h @@ -37,14 +37,13 @@ #define ABSL_CONTAINER_NODE_HASH_MAP_H_ #include <cstddef> -#include <tuple> +#include <memory> #include <type_traits> #include <utility> #include "absl/algorithm/container.h" -#include "absl/base/macros.h" +#include "absl/container/hash_container_defaults.h" #include "absl/container/internal/container_memory.h" -#include "absl/container/internal/hash_function_defaults.h" // IWYU pragma: export #include "absl/container/internal/node_slot_policy.h" #include "absl/container/internal/raw_hash_map.h" // IWYU pragma: export #include "absl/memory/memory.h" @@ -114,9 +113,8 @@ class NodeHashMapPolicy; // if (result != ducks.end()) { // std::cout << "Result: " << result->second << std::endl; // } -template <class Key, class Value, - class Hash = absl::container_internal::hash_default_hash<Key>, - class Eq = absl::container_internal::hash_default_eq<Key>, +template <class Key, class Value, class Hash = DefaultHashContainerHash<Key>, + class Eq = DefaultHashContainerEq<Key>, class Alloc = std::allocator<std::pair<const Key, Value>>> class node_hash_map : public absl::container_internal::raw_hash_map< |