W
wolverine
Hi,
I have read that to erase an element from a vector with
reverse_iterator we have to use
-- vector.erase( (++reverseItr).base()) -- But assuming i have to
delete the first element of the vector ( zeroth index), would this
result in undefined behavior. My thinking is like, since the
reverseItr is already pointing to the first element of the vector,
when we increment it and try to get the base, will this work ?
Thanks in advance
Kiran
I have read that to erase an element from a vector with
reverse_iterator we have to use
-- vector.erase( (++reverseItr).base()) -- But assuming i have to
delete the first element of the vector ( zeroth index), would this
result in undefined behavior. My thinking is like, since the
reverseItr is already pointing to the first element of the vector,
when we increment it and try to get the base, will this work ?
Thanks in advance
Kiran