C++11 adds the following containers: array
, forward_list
, unordered_set
, and the unordered associative containers unordered_multiset
, unordered_map
, and unordered_multimap
.
An array
container, once declared, is fixed in size and uses static or stack memory rather than dynamically allocated memory. It’s intended as a substitute for the built-in array type; it’s more limited than vector
, but more efficient.
The list
container is a bidirectional linked list, with each item, other than the two ends, linked to the item before it and the one after. The forward_list
is a singly linked list, with each item, other than the last, linked to the next item. It provides a more compact, but more limited, alternative for list
.
Like set
and the other associative containers, the unordered associative containers allow fast data retrieval through the use of keys. The difference is that the associative containers use trees as the underlying data structure, whereas the unordered associative containers use hash tables.
18.221.123.73