Add detail/pair header

This commit is contained in:
Ion Gaztañaga
2024-06-13 22:46:37 +02:00
parent acd4f41eda
commit d1d8c43c2d

View File

@@ -31,6 +31,7 @@
#include <boost/container/detail/mpl.hpp> #include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/algorithm.hpp> //equal() #include <boost/container/detail/algorithm.hpp> //equal()
#include <boost/container/detail/container_or_allocator_rebind.hpp> #include <boost/container/detail/container_or_allocator_rebind.hpp>
#include <boost/container/detail/pair.hpp>
// move // move
#include <boost/move/utility_core.hpp> #include <boost/move/utility_core.hpp>
#include <boost/move/traits.hpp> #include <boost/move/traits.hpp>
@@ -44,6 +45,7 @@
#include <boost/intrusive/detail/minimal_pair_header.hpp> //pair #include <boost/intrusive/detail/minimal_pair_header.hpp> //pair
#include <boost/intrusive/detail/minimal_less_equal_header.hpp>//less, equal #include <boost/intrusive/detail/minimal_less_equal_header.hpp>//less, equal
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
#include <initializer_list> #include <initializer_list>
#endif #endif
@@ -1671,9 +1673,8 @@ class flat_map
iterator i = this->lower_bound(k); iterator i = this->lower_bound(k);
// i->first is greater than or equivalent to k. // i->first is greater than or equivalent to k.
if (i == end() || key_comp()(k, (*i).first)){ if (i == end() || key_comp()(k, (*i).first)){
dtl::value_init<mapped_type> m; impl_value_type v(k, mapped_type());
impl_value_type v(k, ::boost::move(m.m_t)); i = this->m_flat_tree.insert_equal(::boost::move(v));
i = this->insert(i, ::boost::move(v));
} }
return (*i).second; return (*i).second;
} }
@@ -1682,10 +1683,9 @@ class flat_map
key_type &k = mk; key_type &k = mk;
iterator i = this->lower_bound(k); iterator i = this->lower_bound(k);
// i->first is greater than or equivalent to k. // i->first is greater than or equivalent to k.
if (i == end() || key_comp()(k, (*i).first)){ if (i == end() || key_comp()(k, (*i).first)) {
dtl::value_init<mapped_type> m; impl_value_type v(boost::move(k), mapped_type());
impl_value_type v(::boost::move(k), ::boost::move(m.m_t)); i = this->m_flat_tree.insert_equal(::boost::move(v));
i = this->insert(i, ::boost::move(v));
} }
return (*i).second; return (*i).second;
} }
@@ -1765,7 +1765,7 @@ flat_map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, A
template <class Key, class T, class Compare, class AllocatorOrContainer> template <class Key, class T, class Compare, class AllocatorOrContainer>
struct has_trivial_destructor_after_move<boost::container::flat_map<Key, T, Compare, AllocatorOrContainer> > struct has_trivial_destructor_after_move<boost::container::flat_map<Key, T, Compare, AllocatorOrContainer> >
{ {
typedef ::boost::container::dtl::pair<Key, T> value_t; typedef typename boost::container::flat_map<Key, T, Compare, AllocatorOrContainer>::value_type value_t;
typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t; typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t;
typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree; typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree;
BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
@@ -3099,7 +3099,7 @@ namespace boost {
template <class Key, class T, class Compare, class AllocatorOrContainer> template <class Key, class T, class Compare, class AllocatorOrContainer>
struct has_trivial_destructor_after_move< boost::container::flat_multimap<Key, T, Compare, AllocatorOrContainer> > struct has_trivial_destructor_after_move< boost::container::flat_multimap<Key, T, Compare, AllocatorOrContainer> >
{ {
typedef ::boost::container::dtl::pair<Key, T> value_t; typedef typename boost::container::flat_multimap<Key, T, Compare, AllocatorOrContainer>::value_type value_t;
typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t; typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t;
typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree; typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree;
BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;