Like the question says, can you remove an element from a std::unordered_set
using a bucket iterator (local_iterator
)? I can see two possible solutions:
- Since erase() does only accept global
iterator
s, is there equivalent functionality forlocal_iterator
? - Is it possible to obtain the equivalent global
iterator
for alocal_iterator
?
If it's not feasible, please elaborate on why it's not.
it
and++it
in the same function call. – Intemeratestd::remove_if
. It doesn't actually remove elements. – Almiralocal_iterator
toiterator
usingunordered_set.find(*local_iterator)
– Consumer