That's something of a bummer with the current mapping iterators, I think.
Why? It only happens at the first write, so it doesn't have that big effect, does it?
Anyway, I'd like them to have the same behaviour. And since it's easier to make a controlled copy (isn't it?) of the set you want to index over then continuously looping over inserted items, you're probably correct in that behaviour.
/ Mirar
Previous text:
2003-01-30 20:50: Subject: Multiset iterator
Being consistent with mappings is the only good reason to do otherwise, afaics. Otoh I don't think it's impossible to make mapping iterators work with changing indices too, but I haven't looked into that in detail.
Is that behaviour useful in a practical situation?
If nothing else, it avoids a copy-on-write if you go through a set to remove items. That's something of a bummer with the current mapping iterators, I think.
/ Martin Stjernholm, Roxen IS