diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index 7ebfc43..390f0f0 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -31,6 +31,7 @@ #include #include //equal() #include +#include // move #include #include @@ -44,6 +45,7 @@ #include //pair #include //less, equal + #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) #include #endif @@ -1671,9 +1673,8 @@ 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)){ - dtl::value_init m; - impl_value_type v(k, ::boost::move(m.m_t)); - i = this->insert(i, ::boost::move(v)); + impl_value_type v(k, mapped_type()); + i = this->m_flat_tree.insert_equal(::boost::move(v)); } return (*i).second; } @@ -1682,10 +1683,9 @@ class flat_map key_type &k = mk; iterator i = this->lower_bound(k); // i->first is greater than or equivalent to k. - if (i == end() || key_comp()(k, (*i).first)){ - dtl::value_init m; - impl_value_type v(::boost::move(k), ::boost::move(m.m_t)); - i = this->insert(i, ::boost::move(v)); + 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)); } return (*i).second; } @@ -1765,7 +1765,7 @@ flat_map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, A template struct has_trivial_destructor_after_move > { - typedef ::boost::container::dtl::pair value_t; + typedef typename boost::container::flat_map::value_type value_t; typedef typename ::boost::container::dtl::container_or_allocator_rebind::type alloc_or_cont_t; typedef ::boost::container::dtl::flat_tree, Compare, alloc_or_cont_t> tree; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; @@ -3099,7 +3099,7 @@ namespace boost { template struct has_trivial_destructor_after_move< boost::container::flat_multimap > { - typedef ::boost::container::dtl::pair value_t; + typedef typename boost::container::flat_multimap::value_type value_t; typedef typename ::boost::container::dtl::container_or_allocator_rebind::type alloc_or_cont_t; typedef ::boost::container::dtl::flat_tree, Compare, alloc_or_cont_t> tree; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value;