This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/58153] unordered_multimap::erase(iterator) is not constant-time when many entries have the same key


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

--- Comment #4 from Kenton Varda <temporal at gmail dot com> ---
> This report entry made me wonder why iterators could not just be
> pointing to the node just before the one containing the pointed to value.

That's a neat idea.

I think there is an obscure issue, though.  If I have an iterator pointing at
item N, and then I (separately) erase item N - 1, what happens to my iterator?

But you bring up another, simpler point:  why not just have an erase_after()
method like forward_list does?  That would suit my use case (although at this
point I've rewritten it to do something different).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]