diff --git a/include/boost/container/deque.hpp b/include/boost/container/deque.hpp index 6a85ae9..d3ca4ca 100644 --- a/include/boost/container/deque.hpp +++ b/include/boost/container/deque.hpp @@ -1603,8 +1603,10 @@ class deque : protected deque_base template void priv_insert_aux(const_iterator pos, InpIt first, InpIt last, std::input_iterator_tag) { + iterator it(pos); for(;first != last; ++first){ - this->insert(pos, boost::move(value_type(*first))); + it = this->emplace(it, *first); + ++it; } } diff --git a/include/boost/container/vector.hpp b/include/boost/container/vector.hpp index e4235ef..f24699e 100644 --- a/include/boost/container/vector.hpp +++ b/include/boost/container/vector.hpp @@ -1412,9 +1412,10 @@ class vector : private container_detail::vector_alloc_holder template void priv_range_insert(const_iterator pos, InIt first, InIt last, std::input_iterator_tag) { + iterator it(pos.get_ptr()); for(;first != last; ++first){ - pos = this->emplace(pos, *first); - ++pos; + it = this->emplace(it, *first); + ++it; } }