Answer by Arun for Iterating a changing container
The operations which mutate the set structure are insert() and erase(). While iterating, consider using the iterator returned by the mutating operations.it = myset.erase( it...
View ArticleAnswer by Sergey Kalinichenko for Iterating a changing container
There is a way to do it in two steps: first, go through the original set, and make a set of action items. Then go through the set of action items, and apply them to the original set.An action item is a...
View ArticleAnswer by sehe for Iterating a changing container
Two basic approaches come to mind:use a task based approach (with the collection locked, push tasks onto a queue for each element, then release all parties to do work and wait till completion). You'll...
View ArticleIterating a changing container
I am iterating over a set of callback functions. Functions are called during iteration and may lead to drastic changes to the actual container of the functions set.What I am doing now is:make a copy of...
View Article