Use Reverse Iterator Adapters to Iterate Backward
Learn to use reverse iterator adapters to iterate backward.
We'll cover the following
A reverse iterator adapter is an abstraction that reverses the direction of an iterator class. It requires a
How to do it
Most bidirectional containers in the STL include a reverse iterator adapter. Other containers, such as the primitive C-array, do not. Let’s look at some examples:
Let’s start with the
printc()
function we’ve used throughout this chapter:
Get hands-on with 1400+ tech skills courses.