From 5ae23ed130027e2376e0868ec4bb4fa358b7e238 Mon Sep 17 00:00:00 2001 From: Evan Brown Date: Tue, 12 Sep 2023 09:14:32 -0700 Subject: Make PolicyTraits::transfer_uses_memcpy() true for node_hash_* tables. This should enable binary size savings for now and more efficiency improvements with small buffer optimization. PiperOrigin-RevId: 564741270 Change-Id: Icf204d88256243eb60464439a52dd589d7a559cb --- absl/container/internal/common_policy_traits.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'absl/container/internal/common_policy_traits.h') diff --git a/absl/container/internal/common_policy_traits.h b/absl/container/internal/common_policy_traits.h index 3558a543..57eac678 100644 --- a/absl/container/internal/common_policy_traits.h +++ b/absl/container/internal/common_policy_traits.h @@ -93,11 +93,13 @@ struct common_policy_traits { struct Rank0 : Rank1 {}; // Use auto -> decltype as an enabler. + // P::transfer returns std::true_type if transfer uses memcpy (e.g. in + // node_slot_policy). template static auto transfer_impl(Alloc* alloc, slot_type* new_slot, slot_type* old_slot, Rank0) - -> decltype((void)P::transfer(alloc, new_slot, old_slot)) { - P::transfer(alloc, new_slot, old_slot); + -> decltype(P::transfer(alloc, new_slot, old_slot)) { + return P::transfer(alloc, new_slot, old_slot); } #if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606 // This overload returns true_type for the trait below. -- cgit v1.2.3