Std :: insert iterator for unordered sets (or maps)?
Is there an insert-in iterator std::
for unordered sets? As I understand it std::inserter
requires an iterator argument. This is unsafe for unordered containers (at least not boost::unordered_set
) as they can be reallocated during an operation insert
and discard the past tag iterator .begin()
.
So now I have to pass my own iterator, which is essentially boost::function_output_iterator
with a functor that just calls unorderedSet.insert(param1)
.
Why doesn't it std::inserter
even matter what the iterator argument even requires hint
?
source to share
No one has answered this question yet
Check out similar questions: