Skip to content

Containers

Jeongho Nam edited this page Mar 6, 2018 · 1 revision

Containers

Linear Containers

Type Vector Deque List ForwardList
Capacities empty empty empty empty empty
size size size size X
capacity X capacity X X
reserve X reserve X X
Accessors front front front front front
back back back back X
at at at X X
set set set X X
Iterators begin begin begin begin begin
end end end end end
rbegin rbegin rbegin rbegin X
rend rend rend rend X
Modifiers assign assign assign assign assign
clear clear clear clear clear
swap swap swap swap swap
insert insert insert insert insert_after
erase erase erase erase erase_after
push_back push_back push_back push_back X
pop_back pop_back pop_back pop_back X
push_front X push_front push_front X
pop_front X pop_front pop_front X
List Algorithms splice X X splice splice_after
remove X X remove remove
remove_if X X remove_if remove_if
unique X X unique unique
merge X X merge merge
sort X X sort sort
reverse X X reverse reverse

Associative Containers

Categories Tree-based Associative Containers Hash-based Associative Containers
<set> <map> <unordered_set> <unordered_map>
Type TreeSet TreeMultiSet TreeMap TreeMultiMap HashSet HashMultiSet HashMap HashMultiMap
Capacities empty empty empty empty empty empty empty empty empty
size size size size size size size size size
reserve X X X X reserve reserve reserve reserve
Accessors find find find find find find find find find
count count count count count count count count count
has has has has has has has has has
get X X get X X X get X
set set X set X set X set X
lower_bound lower_bound lower_bound lower_bound lower_bound X X X X
upper_bound upper_bound upper_bound upper_bound upper_bound X X X X
equal_range equal_range equal_range equal_range equal_range X X X X
Iterators begin begin begin begin begin begin begin begin begin
end end end end end end end end end
rbegin rbegin rbegin rbegin rbegin rbegin rbegin rbegin rbegin
rend rend rend rend rend rend rend rend rend
Modifiers assign assign assign assign assign assign assign assign assign
clear clear clear clear clear clear clear clear clear
swap swap swap swap swap swap swap swap swap
merge merge X merge X merge X merge X
insert insert insert insert insert insert insert insert insert
erase erase erase erase erase erase erase erase erase
emplace emplace emplace emplace emplace emplace emplace emplace emplace
emplace_hint emplace_hint emplace_hint emplace_hint emplace_hint emplace_hint emplace_hint emplace_hint emplace_hint
extract extract X extract X extract X extract X
insert_or_assign insert_or_assign X insert_or_assign X insert_or_assign X insert_or_assign X
Observers key_comp key_comp key_comp key_comp key_comp X X X X
value_comp value_comp value_comp value_comp value_comp X X X X
hash_function X X X X hash_function hash_function hash_function hash_function
key_eq X X X X key_eq key_eq key_eq key_eq
Buckets bucket X X X X bucket bucket bucket bucket
bucket_count X X X X bucket_count bucket_count bucket_count bucket_count
bucket_size X X X X bucket_size bucket_size bucket_size bucket_size
rehash X X X X rehash rehash rehash rehash
load_factor X X X X load_factor load_factor load_factor load_factor
max_load_factor X X X X max_load_factor max_load_factor max_load_factor max_load_factor