Opened 8 years ago

Closed 7 years ago

#3668 closed Bugs (fixed)

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

Reported by: anonymous Owned by: igaztanaga
Milestone: Boost 1.45.0 Component: intrusive
Version: Boost 1.41.0 Severity: Regression
Keywords: Cc:


please see

and this thread

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:

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by anonymous

"as far as I know there is good solution"


comment:2 Changed 8 years ago by anonymous

related to #3693

comment:3 Changed 7 years ago by anonymous

there appears to be a consensus to change the result of std::unordered_*::erase to "void":

GCC changed it:

comment:4 Changed 7 years ago by igaztanaga

  • Milestone changed from Boost 1.42.0 to Boost-1.45.0
  • Resolution set to fixed
  • Status changed from new to closed

Fixed for Boost 1.45 in release branch

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain igaztanaga.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.