Fixed error in insertions with input iterator ranges

[SVN r80193]
This commit is contained in:
Ion Gaztañaga
2012-08-25 08:54:03 +00:00
parent 2947abfdef
commit 011f1fb181
2 changed files with 6 additions and 3 deletions

View File

@@ -1603,8 +1603,10 @@ class deque : protected deque_base<T, A>
template <class InpIt>
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;
}
}

View File

@@ -1412,9 +1412,10 @@ class vector : private container_detail::vector_alloc_holder<A>
template <class InIt>
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;
}
}