
Vector
The vector template is much more complicated. The guiding principle of the stack,
queue, and priority_queue templates was simplicity. The rest of the container
templates have more operations than the data structure they are supposed to model.
We will not cover all of the member functions here, just the basic set. But before we
do, we must cover the concept of an iterator.
The linear classes we have designed have had functions that allow the client to
iterate through the items in an object of the class. The STL considers an iterator to be
an object with member functions outside the container over which it iterates. Many of
the containers have methods ...