At first glance, iterators appear straightforward. Look more closely, however, and you’ll notice that the standard STL containers offer four different iterator types:
const_reverse_iterator. From there it’s only a matter of time until you note that of these four types, only one is accepted by containers in certain forms of
erase. That’s when the questions begin. Why four iterator types? What is the relationship among them? Are they interconvertible? Can the different types be mixed in calls to algorithms and STL utility functions? How do these types relate to containers and their member functions?
This chapter answers these questions, and it introduces an iterator ...