From 2d097fe45cb665a7a642aad1aeaf1521c6eb4e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Fri, 14 Jun 2024 12:37:12 +0200 Subject: [PATCH] Roll back and use dtl::value_init to maximize compatibility between std versions --- include/boost/container/flat_map.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index 390f0f0..9a8abb8 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -1673,8 +1673,9 @@ class flat_map iterator i = this->lower_bound(k); // i->first is greater than or equivalent to k. if (i == end() || key_comp()(k, (*i).first)){ - impl_value_type v(k, mapped_type()); - i = this->m_flat_tree.insert_equal(::boost::move(v)); + dtl::value_init m; + impl_value_type v(k, ::boost::move(m.m_t)); + i = dtl::force_copy(this->m_flat_tree.insert_equal(::boost::move(v))); } return (*i).second; } @@ -1684,8 +1685,9 @@ class flat_map iterator i = this->lower_bound(k); // i->first is greater than or equivalent to k. if (i == end() || key_comp()(k, (*i).first)) { - impl_value_type v(boost::move(k), mapped_type()); - i = this->m_flat_tree.insert_equal(::boost::move(v)); + dtl::value_init m; + impl_value_type v(::boost::move(k), ::boost::move(m.m_t)); + i = dtl::force_copy(this->m_flat_tree.insert_equal(::boost::move(v))); } return (*i).second; }