Opened 13 years ago

Closed 12 years ago

#3668 closed Bugs (fixed)

unordered_*::erase(iterator) should not return an iterator

Reported by: anonymous Owned by: Ion Gaztañaga
Milestone: Boost 1.45.0 Component: intrusive
Version: Boost 1.41.0 Severity: Regression
Keywords: Cc:

Description

please see

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2023.pdf

and this thread

http://lists.boost.org/Archives/boost/2009/11/159116.php

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.

boost.unordered can't simply change the return type since its specified in TR1, but I think boost.intrusive should.

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.

here`s boost.intrusive's implementation that causes the problem:

http://lists.boost.org/Archives/boost/2009/11/159134.php

Change History (4)

comment:1 by anonymous, 13 years ago

"as far as I know there is good solution"

+not

comment:2 by anonymous, 13 years ago

related to #3693

comment:3 by anonymous, 13 years ago

there appears to be a consensus to change the result of std::unordered_*::erase to "void": http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#579

GCC changed it:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41975

comment:4 by Ion Gaztañaga, 12 years ago

Milestone: Boost 1.42.0Boost-1.45.0
Resolution: fixed
Status: newclosed

Fixed for Boost 1.45 in release branch

Note: See TracTickets for help on using tickets.