Container and container classes in C++

A container is an object that holds another object and since it is an object it has a class known as a container class. Containers are of two types: Sequence containers and associate containers. A sequence container is in the form of a list. An associate container is based on keys. For Example: maps.

Here are the containers used by STL:

Container Name Function Included in Header
list To store a linear list <list>
set To store a set <set>
multiset To store a set where elements may not be unique <set>
stack To store a stack <stack>
vector To store a dynamic array <vector>
queue To store a queue <queue>
priority_queue To store a priority_queue <queue>
deque To store a double end queue <queue>
map To store key and value <map>
multimap To store key and value, where one key can be related to many values <map>
bitset To store a set of bits <bitset>


Leave a Reply