Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

4.1 Overview

The Standard C++ 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 Standard C++ Library, and describes the most significant characteristic of each. Table 7 does the same for the container adaptors.

Table 6 -- Container types provided by the Standard C++ Library

NameCharacteristic
vector
Random access to elements, efficient insertion at end
vector<bool>
Specialization of vector optimized for bool
list
Efficient insertion and removal throughout
deque
Random access, efficient insertion at front or back
set
Elements maintained in order, efficient test for inclusion, insertion, and removal
multiset
Set with repeated copies
bitset
Bit container templated on size rather than contained type
map
Access to values via keys, efficient insertion and removal
multimap
Map permitting duplicate keys
string
Character container enhanced for string operations

Table 7 -- Container adaptors of the Standard C++ Library

NameCharacteristic
stack
Insertions and removals only from top
queue
Insertions at back, removals from front
priority queue
Efficient access and removal of largest values


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.


OEM Release, June 1998