diff options
Diffstat (limited to 'absl/container/flat_hash_set.h')
-rw-r--r-- | absl/container/flat_hash_set.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/absl/container/flat_hash_set.h b/absl/container/flat_hash_set.h index a94a82a0..cd74923c 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 <memory> #include <type_traits> #include <utility> @@ -473,9 +474,11 @@ struct FlatHashSetPolicy { std::forward<Args>(args)...); } + // Return std::true_type in case destroy is trivial. template <class Allocator> - static void destroy(Allocator* alloc, slot_type* slot) { + static auto destroy(Allocator* alloc, slot_type* slot) { absl::allocator_traits<Allocator>::destroy(*alloc, slot); + return IsDestructionTrivial<Allocator, slot_type>(); } static T& element(slot_type* slot) { return *slot; } |