Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
Containers
Summary
A standard template library (STL) collection.
Contents
Description●
Container Requirements●
Reversible Containers●
Sequences●
Associative Containers●
See Also●
Description
Within the standard template library, collection classes are often described as containers. A
container stores a collection of other objects and provides certain basic functionality that
supports the use of generic algorithms. Containers come in two basic flavors: sequences, and
associative containers. They are further distinguished by the type of iterator they support.
A sequence supports a linear arrangement of single elements. vector, list, deque, bitset, and
string fall into this category. Associative containers map values onto keys, which provides
efficient retrieval of the values based on the keys. The STL provides the map, multimap, set
and multiset associative containers. map and multimap store the value and the key separately
and allow for fast retrieval of the value, based upon fast retrieval of the key. set and multiset
store only keys allowing fast retrieval of the key itself.
Container Requirements
Containers within the STL must meet the following requirements. Sequences and associative
containers must also meet their own separate sets of requirements. The requirements for
containers are: