Afficher un message
Vieux 21/02/2008, 15h16   #1
thomas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut vector.erase(iterator iter) will change "iter" or not?

suppose I will delete an element pointed to by "iter".
like this:

vector<int> s;
for(vector<int>::iterator iter=s.begin(); iter!=s.end(); iter++){
if(*iter==3)
s.erase(iter); //A
}

in line A, if element by "iter" is erased, will "iter" point to the
next element(now should be the current element) automatically?
  Réponse avec citation
 
Page generated in 0,04825 seconds with 9 queries