#include <iostream>
#include <vector>
int main ()
{
std::vector<int> bar = {1,2,3,4,5};
std::vector<int>::reverse_iterator it = bar.rend();
std::cout<<*(it-1);
return 0;
}
No matter if you're using reverse iterators or not, it's always begin → end.
(The reverse end is not the beginning. Rather, it's one-past-the-beginning.)
To run through the range in forward order, iterate from begin() to end().
To run through the range in reverse order, iterate from rbegin() to rend().