Also note: as long as the iterator is live it has a reference to the original mapping/multiset data, so "normal" changes (insert/remove item) should not cause a modification of the thing the iterator is looping over, instead a new copy will be created.
Note, however, that the fun move-to-head-when-indexing thing did not bother to check for writable mapping data, at least in 7.8. :)