Introduction
Explore the fundamental operations of C++ containers including creation, size determination, element access, and assignment. Understand how allocators enable dynamic sizing and the common features shared by sequential and associative containers.
We'll cover the following...
Although the sequential and associative containers of the Standard Template library are two very different classes of containers, they have a lot in common. For example, the operations used to create or delete a container, to determine its size, to access its elements, to assign or swap, are all independent of the type of elements in a container. It is common for the containers to be defined with an arbitrary size. The reason is that each container has an allocator, hence the size of a container can be adjusted at runtime. The allocator works in the background most of the time. ...