diff --git a/include/boost/container/detail/flat_tree.hpp b/include/boost/container/detail/flat_tree.hpp index a68e7b2..f274211 100644 --- a/include/boost/container/detail/flat_tree.hpp +++ b/include/boost/container/detail/flat_tree.hpp @@ -506,7 +506,7 @@ class flat_tree >::type * = 0 #endif ) - { this->m_data.m_vect.merge_unique(first, last); } + { this->m_data.m_vect.merge_unique(first, last, value_compare()); } #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) diff --git a/include/boost/container/vector.hpp b/include/boost/container/vector.hpp index 341832b..1cf44c8 100644 --- a/include/boost/container/vector.hpp +++ b/include/boost/container/vector.hpp @@ -2292,7 +2292,7 @@ class vector //Merge in new buffer loop while(1){ if(!n) { - ::boost::container::uninitialized_move_alloc(this->m_holder.alloc(), pbeg, pend, d_first); + ::boost::container::uninitialized_move_alloc(this->m_holder.alloc(), pbeg, pend, d_first); break; } else if(pbeg == pend) { @@ -2300,8 +2300,9 @@ class vector break; } //maintain stability moving external values only if they are strictly less - else if(comp(*first, *pbeg)) { - *d_first = ::boost::move(*first); + else if(comp(*first, *pbeg)) { + allocator_traits_type::construct( this->m_holder.alloc(), d_first, ::boost::move(*first) ); + new_values_destroyer.increment_size(1u); ++first; --n; ++d_first; @@ -2312,7 +2313,8 @@ class vector --added; } else{ - *d_first = ::boost::move(*pbeg); + allocator_traits_type::construct( this->m_holder.alloc(), d_first, ::boost::move(*pbeg) ); + new_values_destroyer.increment_size(1u); ++pbeg; ++d_first; }