Iterating C++ vector from the end to the begin

Is it possible to iterate a vector from the end to the begin?

for (vector<my_class>::iterator i = my_vector.end();
        i != my_vector.begin(); /* ?! */ ) {
}

Or is that only possible with something like that:

for (int i = my_vector.size() - 1; i >= 0; --i) {
}
78
задан Daniel Daranas 10 September 2013 в 14:44
поделиться