diff --git a/include/boost/container/detail/advanced_insert_int.hpp b/include/boost/container/detail/advanced_insert_int.hpp index d9cba48..fc8a33a 100644 --- a/include/boost/container/detail/advanced_insert_int.hpp +++ b/include/boost/container/detail/advanced_insert_int.hpp @@ -125,8 +125,16 @@ struct insert_value_initialized_n_proxy void uninitialized_copy_n_and_update(Allocator &a, Iterator p, size_type n) const { boost::container::uninitialized_value_init_alloc_n(a, n, p); } - void copy_n_and_update(Allocator &, Iterator, size_type) const - { BOOST_ASSERT(false); } + void copy_n_and_update(Allocator &a, Iterator p, size_type n) const + { + for (; 0 < n; --n, ++p){ + typename aligned_storage::value>::type stor; + value_type &v = *static_cast(static_cast(stor.data)); + alloc_traits::construct(a, &v); + value_destructor on_exit(a, v); (void)on_exit; + *p = ::boost::move(v); + } + } }; template @@ -139,8 +147,18 @@ struct insert_default_initialized_n_proxy void uninitialized_copy_n_and_update(Allocator &a, Iterator p, size_type n) const { boost::container::uninitialized_default_init_alloc_n(a, n, p); } - void copy_n_and_update(Allocator &, Iterator, size_type) const - { BOOST_ASSERT(false); } + void copy_n_and_update(Allocator &a, Iterator p, size_type n) const + { + if(!is_pod::value){ + for (; 0 < n; --n, ++p){ + typename aligned_storage::value>::type stor; + value_type &v = *static_cast(static_cast(stor.data)); + alloc_traits::construct(a, &v, default_init); + value_destructor on_exit(a, v); (void)on_exit; + *p = ::boost::move(v); + } + } + } }; template