I just tried to delete some members from set while iterating with this code:
while(*it<=b){ if(*it!=x){m[*it]=x;s.erase(it);} else it++; }
I found out the right one was this, but can't figure out why
while(*it<=b){ if(*it!=x){m[*it]=x;s.erase(it++);} else it++; }
could anybody explain why it++ instead of it please?