Top "Reverse-iterator" questions

Related specifically to iterators that traverses a container in reverse order.

Why use rbegin() instead of end() - 1?

I'm wondering what the benefits of using rbegin() rather than end() - 1 are for STL containers. For example, why would …

c++ vector stl iterator reverse-iterator
How do you use find_if along with reverse_iterator on a C-style array?

To search the first occurence of a element in a C-Array with POD elements, one ease can do this with …

c++ arrays iterator reverse-iterator
STL iterator before std::map::begin()

In C++11's std::map, is there some valid iterator x such that ++x is guaranteed to equal map::begin()? …

c++ c++11 stl iterator reverse-iterator
Is it safe to use std::prev(vector.begin()) or std::next(vector.begin(), -1) like some_container.rend() as reversed sentry?

I wrote some code that takes iterators but have to do comparison in reversed order, template<class ConstBiIter> …

c++ c++11 iterator reverse-iterator
Get index in vector from reverse iterator

I know how to get the index from a vector iterator, by subtracting the begin iterator from it. For example: …

c++ vector iterator find reverse-iterator