I think it's because the behavior would be almost completely undefined if the mapping changes; there might be a rehash and then the iterator is effectively randomized even if it held on to the same keypair.
A way to solve it would be to introduce a "verbatim" mode where the data block never is shrunk and only grown at the end (the multisets have such a mode), and then iterate through the keypair block directly instead of through the hash table. This way one could make new elements always be inserted either behind or ahead of the iterator. The data block would only stay in verbatim mode as long as there are iterators for it.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-01-30 22:16: Subject: Multiset iterator
Yes.
What was the old problems with looping over mappings? I forgot. What was the reasons for the current design?
Is it at all possible to let a mapping iterator loop over new elements?
/ Mirar