I want to be able to remove multiple elements from a set while I am iterating over it. Initially I hoped that iterators were smart enough for the naive solution below to wor
Why don't you use the iterator's remove method on the objects you want to remove?
Iterators were introduced mainly because enumerators couldn't handle deleting while enumerating.