Although we can use subscripts to access the characters of a
string or the elements in a
vector, there is a more general mechanism—known as iterators—that we can use for the same purpose. As we’ll see in Part II, in addition to
vector, the library defines several other kinds of containers. All of the library containers have iterators, but only a few of them support the subscript operator. Technically speaking, a
string is not a container type, but
string supports many of the container operations. As we’ve seen
vector has a subscript operator. Like
strings also have iterators.
Like pointers (§ ...