J
jose luis fernandez diaz
Hi,
Is this right any stl container (vector, deque, list, . . .)?
typedef vector container;
int main()
{
container<int> c1;
c1.push_back(1);
c1.push_back(2);
c1.push_back(3);
container<int>::iterator it=c1.begin();
while(it != c1.end())
{
if(*it=2)
c1.erase(it);
it++;
}
}
Thanks,
Jose Luis.
Is this right any stl container (vector, deque, list, . . .)?
typedef vector container;
int main()
{
container<int> c1;
c1.push_back(1);
c1.push_back(2);
c1.push_back(3);
container<int>::iterator it=c1.begin();
while(it != c1.end())
{
if(*it=2)
c1.erase(it);
it++;
}
}
Thanks,
Jose Luis.