Boost C++ Libraries: Ticket #9931: flat_map::insert(ordered_unique_range_t...) fails with move_iterators https://svn.boost.org/trac10/ticket/9931 <p> This code asserts: </p> <blockquote> <p> flat_map&lt;int, std::string&gt; m1; m1.emplace(1, "one"); m1.emplace(5, "five"); m1.emplace(3, "three"); </p> </blockquote> <blockquote> <p> flat_map&lt;int, std::string&gt; m2; m2.emplace(6, "six"); m2.emplace(7, "seven"); m2.emplace(8, "eight"); </p> </blockquote> <blockquote> <p> m1.insert( </p> <blockquote> <p> boost::container::ordered_unique_range_t(), std::make_move_iterator(std::begin(m2)), std::make_move_iterator(std::end(m2))); </p> </blockquote> </blockquote> <blockquote> <p> assert(m1<a class="changeset" href="https://svn.boost.org/trac10/changeset/6" title="New repository initialized by cvs2svn.">[6]</a> == "six"); <em> &lt;- fails, m1<a class="changeset" href="https://svn.boost.org/trac10/changeset/6" title="New repository initialized by cvs2svn.">[6]</a> is empty </em></p> </blockquote> <p> insert() accesses the iterator multiple times, trying to determine if it can insert a range of values in a burst. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9931 Trac 1.4.3 Ion Gaztañaga Mon, 21 Apr 2014 19:25:41 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9931#comment:1 https://svn.boost.org/trac10/ticket/9931#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. I've reproduced it and found that due to the internal representation of flat_map using a custom pair, a conversion was triggered when dereferencing the iterator when inserting. Fixed in: </p> <p> [develop 5013f3f] Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9931" title="#9931: Bugs: flat_map::insert(ordered_unique_range_t...) fails with move_iterators (closed: fixed)">#9931</a> ("flat_map::insert(ordered_unique_range_t...) fails with move_iterators") </p> Ticket anonymous Sun, 01 Feb 2015 12:42:37 GMT <link>https://svn.boost.org/trac10/ticket/9931#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9931#comment:2</guid> <description> <p> It doesn't seem to be fixed in boost 1.57.0, the example code still asserts for me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 01 Feb 2015 12:43:36 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/9931#comment:3 https://svn.boost.org/trac10/ticket/9931#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> Ticket Ion Gaztañaga Tue, 03 Feb 2015 15:14:54 GMT <link>https://svn.boost.org/trac10/ticket/9931#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9931#comment:4</guid> <description> <p> Let me know if: </p> <p> <a class="ext-link" href="https://github.com/boostorg/container/commit/f47bf08ccc9b64da1e6afa6da8ab4e2147ecede8"><span class="icon">​</span>https://github.com/boostorg/container/commit/f47bf08ccc9b64da1e6afa6da8ab4e2147ecede8</a> </p> <p> solves the issue. Thanks. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 06 Dec 2015 09:02:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9931#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9931#comment:5</guid> <description> <p> What about closing this or moving it to support? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Thu, 24 Dec 2015 00:19:49 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9931#comment:6 https://svn.boost.org/trac10/ticket/9931#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Closing as fixed as there is no error report since the last fix. </p> Ticket