I have problems with the map, in the below loop.
//iterator declared as "it" and map declared as "aMap"
//key of a map declared as "key"
while(true){
for(it = aMap.begin(); it != aMap.end(); it++){
//some processing
if(//some condition){
//some processing
aMap.erase(key);
it--;
}
}
//some processing
//some conditions to break...
}
the code can be compiled and works, but skips one entry in the map... it doesnt skip the entry when i remove the "erase" and "it--" statements.
is there a way to resolve this?
any help would be much appreciated...
thanks.