Memory and the C++ Standard Library
The C++ Standard Library provides various classes to allow you to manipulate collections of objects. These classes, called the Standard Template Library (STL), provide a standard way to insert items into collection objects and ways to access the items and iterate through entire collections (called iterators). The STL defines collection classes that are implemented as queues, stacks, or as vectors with random access. These classes will be covered in depth Chapter 5, Using the Standard Library Containers, so in this section we will limit the discussion to just two classes that behave like C++ built in arrays.
Standard Library arrays
The C+ Standard Library provides two containers that give random access via an indexer to the data. These two containers also allow you to access the underlying memory and since they guarantee to store the items sequentially and contiguous in memory, they can be used when you are required to provide a pointer to a buffer. These...