Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74259 - trunk/boost/container
From: igaztanaga_at_[hidden]
Date: 2011-09-06 07:43:41


Author: igaztanaga
Date: 2011-09-06 07:43:41 EDT (Tue, 06 Sep 2011)
New Revision: 74259
URL: http://svn.boost.org/trac/boost/changeset/74259

Log:
Fixed error with input_iterator insertion
Text files modified:
   trunk/boost/container/vector.hpp | 22 +++++++++++-----------
   1 files changed, 11 insertions(+), 11 deletions(-)

Modified: trunk/boost/container/vector.hpp
==============================================================================
--- trunk/boost/container/vector.hpp (original)
+++ trunk/boost/container/vector.hpp 2011-09-06 07:43:41 EDT (Tue, 06 Sep 2011)
@@ -1320,12 +1320,20 @@
    }
 
    template <class FwdIt>
- void priv_range_insert(pointer pos, FwdIt first, FwdIt last, std::forward_iterator_tag)
+ void priv_range_insert(const_iterator pos, FwdIt first, FwdIt last, std::forward_iterator_tag)
    {
       if(first != last){
          const size_type n = std::distance(first, last);
          containers_detail::advanced_insert_aux_proxy<T, FwdIt, T*> proxy(first, last);
- priv_range_insert(pos, n, proxy);
+ priv_range_insert(pos.get_ptr(), n, proxy);
+ }
+ }
+
+ template <class InIt>
+ void priv_range_insert(const_iterator pos, InIt first, InIt last, std::input_iterator_tag)
+ {
+ for(;first != last; ++first){
+ this->emplace(pos, *first);
       }
    }
 
@@ -1756,14 +1764,6 @@
    }
 
    template <class InIt>
- void priv_range_insert(const_iterator pos, InIt first, InIt last, std::input_iterator_tag)
- {
- for(;first != last; ++first){
- this->insert(pos, ::boost::move(value_type(*first)));
- }
- }
-
- template <class InIt>
    void priv_assign_aux(InIt first, InIt last, std::input_iterator_tag)
    {
       //Overwrite all elements we can from [first, last)
@@ -1925,7 +1925,7 @@
    {
       //Dispatch depending on integer/iterator
       typedef typename std::iterator_traits<InIt>::iterator_category ItCat;
- this->priv_range_insert(pos.get_ptr(), first, last, ItCat());
+ this->priv_range_insert(pos, first, last, ItCat());
    }
 
    void priv_check_range(size_type n) const


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