If I'm looping through all the elements in the map, and at a certain spot I need to stop and remove the element then continue, what's the best way to go about it? I guess I could make a list with all the positions that need to be deleted and then delete once all the elements have been gone over, but I have a feeling that isn't the cleanest way to do it.
Actually, I just googled sequence points and indeed i++ must be evaluated in its entirety, including the post-increment, prior to entering the erase() function, so I stand corrected.