@SimonForsberg Alright. My usual method is to "cue" all the indices or values to delete, then remove them after the for-loop. Alternatively, I can reverse the for loop to start at the container size and count to 0, then increment i when I remove something at position i while traversing the loop.
Anyway, I thought maybe it's bad for maintenance reasons. At least, I think I should comment not to continue; the loop or anything since it's delicate code.