I need to iterate over some elements in backward order and I'm using:
for ( /* ... */ it = vec.end() - 1, end = vec.begin() ; it >= end ; --it ) {
// ...
I now that end() - 1
is defined for some containers, including vector, but now I need to know if begin decrement is also defined.
EDIT
I don't know if I could use reverse_iterator, because I'll need to pass these iterators as parameters to std::vector::erase and from the documentation, it looks that they are different types.