Boost C++ Libraries: Ticket #3668: unordered_*::erase(iterator) should not return an iterator https://svn.boost.org/trac10/ticket/3668 <p> please see </p> <p> <a class="ext-link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2023.pdf"><span class="icon">​</span>http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2023.pdf</a> </p> <p> and this thread </p> <p> <a class="ext-link" href="http://lists.boost.org/Archives/boost/2009/11/159116.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2009/11/159116.php</a> </p> <p> in that thread it is mentioned that boost.intrusive doesn't have that problem, but that was referring to boost 1.38, in which erase(iterator) had a void result. </p> <p> boost.unordered can't simply change the return type since its specified in TR1, but I think boost.intrusive should. </p> <p> as far as I know there is good solution to this except a void return type. changing the data structure to enable O(1) erase again creates memory overhead. evaluating the returned iterator only on demand, e.g. on indirection, makes all iterator operations more expensive. </p> <p> here`s boost.intrusive's implementation that causes the problem: </p> <p> <a class="ext-link" href="http://lists.boost.org/Archives/boost/2009/11/159134.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2009/11/159134.php</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3668 Trac 1.4.3 anonymous Tue, 24 Nov 2009 20:17:50 GMT <link>https://svn.boost.org/trac10/ticket/3668#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3668#comment:1</guid> <description> <p> "as far as I know there is good solution" </p> <p> +not </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 29 Nov 2009 02:33:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3668#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3668#comment:2</guid> <description> <p> related to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3693" title="#3693: Feature Requests: unordered_set::erase(iterator) complexity (closed: fixed)">#3693</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 28 Feb 2010 17:07:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3668#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3668#comment:3</guid> <description> <p> there appears to be a consensus to change the result of std::unordered_*::erase to "void": <a class="ext-link" href="http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#579"><span class="icon">​</span>http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#579</a> </p> <p> GCC changed it: </p> <p> <a class="ext-link" href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41975"><span class="icon">​</span>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41975</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Thu, 26 Aug 2010 10:03:58 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/3668#comment:4 https://svn.boost.org/trac10/ticket/3668#comment:4 <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> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.42.0</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> <p> Fixed for Boost 1.45 in release branch </p> Ticket