From 4c7e7c7d94eaaa3bff3142c257d880a468a35934 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 31 Jan 2024 13:45:52 -0800 Subject: Type erased hash_slot_fn that depends only on key types (and hash function). PiperOrigin-RevId: 603148301 Change-Id: Ie2e5702995c9e1ef4d5aaab23bc89a1eb5007a86 --- absl/container/flat_hash_set.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'absl/container/flat_hash_set.h') diff --git a/absl/container/flat_hash_set.h b/absl/container/flat_hash_set.h index cd74923c..1be00195 100644 --- a/absl/container/flat_hash_set.h +++ b/absl/container/flat_hash_set.h @@ -29,6 +29,7 @@ #ifndef ABSL_CONTAINER_FLAT_HASH_SET_H_ #define ABSL_CONTAINER_FLAT_HASH_SET_H_ +#include #include #include #include @@ -492,6 +493,11 @@ struct FlatHashSetPolicy { } static size_t space_used(const T*) { return 0; } + + template + static constexpr HashSlotFn get_hash_slot_fn() { + return &TypeErasedApplyToSlotFn; + } }; } // namespace container_internal -- cgit v1.2.3