From ceadad2e6e7af9389e77de39124aa0326277d0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sun, 8 Sep 2024 00:49:18 +0200 Subject: [PATCH] Avoid rebinding the allocator o container if std::pair is movable (impl_pairt_ is the same type as std_pair_t) --- include/boost/container/flat_map.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index cf6d650..8ec402c 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -163,11 +163,14 @@ class flat_map typedef dtl_pair_t impl_pair_t; #endif - typedef dtl::flat_tree< - impl_pair_t, + typedef dtl::flat_tree< impl_pair_t, dtl::select1st, Compare, + #ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE + AllocatorOrContainer + #else typename dtl::container_or_allocator_rebind::type + #endif > impl_tree_t; impl_tree_t m_flat_tree; // flat tree representing flat_map @@ -1849,7 +1852,11 @@ class flat_multimap impl_pair_t, dtl::select1st, Compare, + #ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE + AllocatorOrContainer + #else typename dtl::container_or_allocator_rebind::type + #endif > impl_tree_t; impl_tree_t m_flat_tree; // flat tree representing flat_map