The C++ Standard Library provides ten alternative forms of containers and three container adaptors. In this chapter we briefly identify these forms, consider their characteristics, and discuss how you might go about selecting which form to use in solving a particular problem. Subsequent chapters then go over each of the different forms in more detail.
Table 6 lists the container types provided by the C++ Standard Library, and describes the most significant characteristic of each. Table 7 does the same for the container adaptors.
Random access to elements, efficient insertion at back
Specialization of vector optimized for bool
Efficient insertion and removal throughout
Random access, efficient insertion at front or back
Elements maintained in order, efficient tests for inclusion, insertion, and removal
Set with repeated copies
Bit container. Specialized on size rather than contained type
Access to values via keys, efficient insertion and removal
Map permitting duplicate keys
Character container enhanced for string operations
Insertions and removals only from back
Insertions at back, removals from front
Efficient access and removal of highest priority items