Boost C++ Libraries: Ticket #7776: vector::assign(Iter first, Iter last) should be implemented more efficiently https://svn.boost.org/trac10/ticket/7776 <p> Current implementation of vector::assign(Iter first, Iter last) is same behavior whether Iter is <a class="missing wiki">ForwardIterator</a> or not. (First, overwrite to current elements, then erase or insert) </p> <p> But if Iter is <a class="missing wiki">ForwardIterator</a> and capacity() &lt; 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). </p> <p> Note: according to C++11 specification, value_type need not be <a class="missing wiki">MoveInsertable</a> into Container if Iter is <a class="missing wiki">ForwardIterator</a>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7776 Trac 1.4.3 Ion Gaztañaga Thu, 11 Aug 2016 22:23:51 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7776#comment:1 https://svn.boost.org/trac10/ticket/7776#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Reviewing old bugs. Seems like this was fixed in commit: </p> <p> <a class="ext-link" href="https://github.com/boostorg/container/commit/f2947c115eca4a8d5da0340e469a87d09588718c"><span class="icon">​</span>https://github.com/boostorg/container/commit/f2947c115eca4a8d5da0340e469a87d09588718c</a> </p> <p> and official at least since Boost 1.56. Thanks for the report. </p> Ticket