deque: iterator invalidation
I'm trying to create an iterator invalidation with a deque...but with no success
i'm trying something like:
using namespace std;
deque<int> d;
d.push_back(2);
for (deque<int>::iterator it = d.begin() ; it != d.end() ; ++it)
{
if (*it == 1)
continue;
if (*it % 2 == 0)
d.push_back(*it *2 -1);
}
(this is just an example..this code is not trying to do anything special,just something I just typed)
I've read that a push_back may cause an iterator invalidation,but everything works just fine
thanks

