Boost C++ Libraries: Ticket #9092: Unique insertion with hint bug when inserting ordered non-unique sequence https://svn.boost.org/trac10/ticket/9092 <p> As reported in <a class="ext-link" href="http://permalink.gmane.org/gmane.comp.lib.boost.devel/243830"><span class="icon">​</span>http://permalink.gmane.org/gmane.comp.lib.boost.devel/243830</a>, inserting an ordered non-unique sequence in flat_set provokes a crash. The problem lies in function </p> <p> priv_insert_unique_prepare (const_iterator pos, const value_type&amp; val, insert_commit_data &amp;commit_data) </p> <p> where an incorrect iterator is returned when the hint points to a one-past an equivalent element. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9092 Trac 1.4.3 Ion Gaztañaga Sun, 08 Sep 2013 18:58:22 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9092#comment:1 https://svn.boost.org/trac10/ticket/9092#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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85612" title="Fixes #9092">[85612]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9092" title="#9092: Bugs: Unique insertion with hint bug when inserting ordered non-unique sequence (closed: fixed)">#9092</a> </p> Ticket anonymous Wed, 07 Dec 2016 10:46:36 GMT <link>https://svn.boost.org/trac10/ticket/9092#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9092#comment:2</guid> <description> <p> Hello! </p> <p> I got same problem in boost 1.48 and managed to write unit-test with fixed input sequence. Thought it would be good to put and adapt this unit-test in boost. </p> <p> Code: </p> <pre class="wiki"> TEST(BoostFlatSet, ShouldNotCrash_WithCopyAndInsert_OfOrderedNonUniqueSequence) { std::vector&lt;size_t&gt; test_numbers = boost::assign::list_of(4)(6)(8)(11)(13)(18)(18)(24)(26)(28)(31)(33)(38); boost::container::flat_set&lt;size_t&gt; output; EXPECT_NO_FATAL_FAILURE(boost::copy(test_numbers, std::inserter(output, output.end()))); } </pre><p> Thanks! </p> <p> Roman Vlasov </p> </description> <category>Ticket</category> </item> </channel> </rss>