diff --git a/include/boost/container/detail/node_alloc_holder.hpp b/include/boost/container/detail/node_alloc_holder.hpp index 04ca447..a103e63 100644 --- a/include/boost/container/detail/node_alloc_holder.hpp +++ b/include/boost/container/detail/node_alloc_holder.hpp @@ -349,10 +349,11 @@ struct node_alloc_holder dtl::scoped_destructor sdestructor(nalloc, 0); while(n){ --n; + p = boost::movelib::iterator_to_raw_pointer(itbeg); + ++itbeg; //Increment iterator before overwriting pointed memory //This does not throw - p = ::new(boost::movelib::iterator_to_raw_pointer(itbeg), boost_container_new_t()) Node; + p = ::new(p, boost_container_new_t()) Node; node_deallocator.set(p); - ++itbeg; //This can throw boost::container::construct_in_place(nalloc, p->get_real_data_ptr(), beg); sdestructor.set(p);