All are valid because inverse iterators are, in fact, forward iterators.
A reverse iterator is not a category of iterators. Recall some categories of iterators:
- An iterator that can be dereferenced (
*
) and enlarged ( ++
) is the forward iterator. - A promising iterator that can also be reduced is a bidirectional iterator.
- A random access iterator is a biederment iterator that also has the
+
and -
operators.
The reverse iterator, on the other hand, is a bidirectional iterator or random access iterator that accesses the collection in reverse order. Take a look
http://www.cplusplus.com/reference/std/iterator/reverse_iterator/
... especially what he says about iterator_category under the heading "Member Types".
source share