Sequence containers
vector list deque array forward_list
deque
is not guaranteed to store all its elements in contiguous storage locations but has efficient insertion and deletion of elements at the beginning and end of a sequence.- Unlike the other standard containers,
array
has a fixed size. - Forward lists are sequence containers that allow constant time insert and erase operations anywhere within the sequence.
forward_list
has been designed with efficiency in mind. By design, it is as efficient as a simple handwritten C-style singly-linked list, and in fact is the only standard container to deliberately lack a size member.
Container adapters
stack queue priority_queue
- By default, if no container class is specified for a particular
priority_queue
class instantiation, the standard containervector
is used. - priority_queue is a heap
Associative containers
set map multiset multimap
multiset
,set
andmap
are typically implemented as binary search trees.map
is generally slower thanunordered_map
containers to access individual elements by their key, but it allows the direct iteration on subsets based on their order.
Unordered associative containers
unordered_multiset unordered_map unordered_multimap unordered_set
unordered_set
is faster thanset
containers to access individual elements by their key.