Standard Library Containers Standard Containers std::
Containers
Sequence
doubly-linked list; O(1) insert, erase & splicing; in practice often slower than vector
singly-linked list; O(1) insert, erase & splicing; needs less memory than list
;
in practice often slower than vector
Associative
Containers that allow non-unique keys:
multiset
multimap
unordered_multiset
unordered_multimap
Special
pair<A,B>
contains 2 values of same or different type
tuple<A,B,C,…>
contains many values of same or different type
optional<T>
contains either one value of type T or no value
variant<A,B,C,…>
contains one value of either type A or type B or type C, …
any
contains one value of any
Views
Contiguous Sequence Views
- lightweight (= cheap to copy, can be passed by value)
- non-owning (= not responsible for allocating or deleting memory)
string_view
C++17
view of a string-like character sequence