Boost C++ Libraries: Ticket #7269: vector::insert inserts in reverse order https://svn.boost.org/trac10/ticket/7269 <p> When inserting an input range into a boost.container vector, the items are inserted in the reverse order, or the program crashes. </p> <p> The problem appears to be in </p> <pre class="wiki"> template &lt;class InIt&gt; void priv_range_insert(const_iterator pos, InIt first, InIt last, std::input_iterator_tag) { for(;first != last; ++first){ this-&gt;emplace(pos, *first); } } </pre><p> where pos is not updated after each insertion. </p> <p> In the attached file, <code>v1</code> is ok, but <code>v2</code> is reversed. If <code>v2.reserve(5)</code> is removed, the program crashes. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7269 Trac 1.4.3 Yechezkel Mett <ymett.on.boost@…> Thu, 23 Aug 2012 15:15:25 GMT attachment set https://svn.boost.org/trac10/ticket/7269 https://svn.boost.org/trac10/ticket/7269 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">container_vector_bug.cpp</span> </li> </ul> Ticket Ion Gaztañaga Fri, 24 Aug 2012 20:38:14 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7269#comment:1 https://svn.boost.org/trac10/ticket/7269#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> Thanks for the report fixed in trunk at revision: 80172 </p> Ticket