Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //m - some std::map
- auto it = m.begin()
- while(it != m.end()) {
- if (/*condition, should remove*/) {
- m.erase(it++);
- } else {
- //do something with it
- ++it;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement