aboutsummaryrefslogtreecommitdiff
path: root/absl/container/node_hash_set.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2024-01-31 13:45:52 -0800
committerCopybara-Service <copybara-worker@google.com>2024-01-31 13:46:58 -0800
commit4c7e7c7d94eaaa3bff3142c257d880a468a35934 (patch)
treeb8418ca1620a45c7c772945194e9537165ac13f4 /absl/container/node_hash_set.h
parent780bfc194d807dbd56363635ca40bf96743aa00b (diff)
downloadabseil-4c7e7c7d94eaaa3bff3142c257d880a468a35934.tar.gz
abseil-4c7e7c7d94eaaa3bff3142c257d880a468a35934.tar.bz2
abseil-4c7e7c7d94eaaa3bff3142c257d880a468a35934.zip
Type erased hash_slot_fn that depends only on key types (and hash function).
PiperOrigin-RevId: 603148301 Change-Id: Ie2e5702995c9e1ef4d5aaab23bc89a1eb5007a86
Diffstat (limited to 'absl/container/node_hash_set.h')
-rw-r--r--absl/container/node_hash_set.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/container/node_hash_set.h b/absl/container/node_hash_set.h
index 421ff460..ec9ab519 100644
--- a/absl/container/node_hash_set.h
+++ b/absl/container/node_hash_set.h
@@ -35,10 +35,12 @@
#ifndef ABSL_CONTAINER_NODE_HASH_SET_H_
#define ABSL_CONTAINER_NODE_HASH_SET_H_
+#include <cstddef>
#include <type_traits>
#include "absl/algorithm/container.h"
#include "absl/base/macros.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_set.h" // IWYU pragma: export
@@ -487,6 +489,11 @@ struct NodeHashSetPolicy
}
static size_t element_space_used(const T*) { return sizeof(T); }
+
+ template <class Hash>
+ static constexpr HashSlotFn get_hash_slot_fn() {
+ return &TypeErasedDerefAndApplyToSlotFn<Hash, T>;
+ }
};
} // namespace container_internal