Boost C++ Libraries: Ticket #2945: set, multiset, map and multimap don't take advantage of insert with hint api https://svn.boost.org/trac10/ticket/2945 <p> Several of the standard containers have an insert function that can be used to improve the efficiency of adding elements to them. Here is some code that uses this function -- abt1 is a std::set&lt;int&gt;. </p> <pre class="wiki">set&lt;int&gt;::iterator endIt1 = abt1.end(); for (unsigned int j0 = 1; j0 &lt;= headCount[0]; ++j0) { // load data into an int named rep. abt1.insert(endIt1, rep); } </pre><p> It is possible someone may want to serialize a non-sorted list&lt;int&gt; to a set&lt;int&gt;. In this case using the hinted insert will be slightly slower than the non-hinted version. This case is somewhat rare though in my opinion. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2945 Trac 1.4.3 Robert Ramey Tue, 14 Apr 2009 04:10:29 GMT status, type, milestone changed https://svn.boost.org/trac10/ticket/2945#comment:1 https://svn.boost.org/trac10/ticket/2945#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.39.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> I've investigated this a little bit and it looks to be a worthwhile enhancement. I'll try this out in due course. </p> Ticket Robert Ramey Sat, 18 Apr 2009 16:33:19 GMT <link>https://svn.boost.org/trac10/ticket/2945#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2945#comment:2</guid> <description> <p> Of course, if this is an area you have interested and ability in, or perhaps an urgent need for, you might want to submit a tested patch. I would be pleased to consider it. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 21 Aug 2009 05:44:49 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/2945#comment:3 https://svn.boost.org/trac10/ticket/2945#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Robert Ramey</span> to <span class="trac-author">Matthias Troyer</span> </li> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> </ul> <p> Matias, </p> <p> Seems to me that this guy is on to something here. Maybe you want to take a look at this. If you don't - re-assign this back to me. </p> <p> Robert Ramey </p> Ticket anonymous Wed, 07 Apr 2010 20:41:02 GMT <link>https://svn.boost.org/trac10/ticket/2945#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2945#comment:4</guid> <description> <p> I have applied this locally and it does indeed make a significant difference. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Thu, 08 Apr 2010 01:17:32 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2945#comment:5 https://svn.boost.org/trac10/ticket/2945#comment:5 <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> I'm pretty sure I added this to version 1.41. That is, I'm pretty sure it's already in there. </p> <p> Robert Ramey </p> Ticket