Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80193 - trunk/boost/container
From: igaztanaga_at_[hidden]
Date: 2012-08-25 04:54:04


Author: igaztanaga
Date: 2012-08-25 04:54:03 EDT (Sat, 25 Aug 2012)
New Revision: 80193
URL: http://svn.boost.org/trac/boost/changeset/80193

Log:
Fixed error in insertions with input iterator ranges
Text files modified:
   trunk/boost/container/deque.hpp | 4 +++-
   trunk/boost/container/vector.hpp | 5 +++--
   2 files changed, 6 insertions(+), 3 deletions(-)

Modified: trunk/boost/container/deque.hpp
==============================================================================
--- trunk/boost/container/deque.hpp (original)
+++ trunk/boost/container/deque.hpp 2012-08-25 04:54:03 EDT (Sat, 25 Aug 2012)
@@ -1603,8 +1603,10 @@
    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;
       }
    }
 

Modified: trunk/boost/container/vector.hpp
==============================================================================
--- trunk/boost/container/vector.hpp (original)
+++ trunk/boost/container/vector.hpp 2012-08-25 04:54:03 EDT (Sat, 25 Aug 2012)
@@ -1412,9 +1412,10 @@
    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;
       }
    }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk