[Boost-bugs] [Boost C++ Libraries] #7776: vector::assign(Iter first, Iter last) should be implemented more efficiently

Subject: [Boost-bugs] [Boost C++ Libraries] #7776: vector::assign(Iter first, Iter last) should be implemented more efficiently
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-09 15:53:53


#7776: vector::assign(Iter first, Iter last) should be implemented more
efficiently
----------------------------------------+-----------------------------------
 Reporter: kariya_mitsuru@… | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.52.0 | Severity: Optimization
 Keywords: |
----------------------------------------+-----------------------------------
 Current implementation of vector::assign(Iter first, Iter last) is same
 behavior whether Iter is ForwardIterator or not. (First, overwrite to
 current elements, then erase or insert)

 But if Iter is ForwardIterator and capacity() < distance(first, last), it
 is only necessary to discard old buffer (including its contents) and
 allocate new buffer which capacity is at least distance(first, last).

 Note: according to C++11 specification, value_type need not be
 MoveInsertable into Container if Iter is ForwardIterator.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7776>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC