자주 사용하는 Sequence container와 Container adaptor의 멤버 함수를 비교해봤다.
array | vector | deque | list | stack | queue | |
---|---|---|---|---|---|---|
Iterators | begin | begin | begin | begin | ||
end | end | end | end | |||
rbegin | rbegin | rbegin | rbegin | |||
rend | rend | rend | rend | |||
cbegin | cbegin | cbegin | cbegin | |||
cend | cend | cend | cend | |||
crbegin | crbegin | crbegin | crbegin | |||
crend | crend | crend | crend | |||
Capacity | size | size | size | size | size | size |
max_size | max_size | max_size | max_size | |||
empty | empty | empty | empty | empty | empty | |
resize | resize | resize | ||||
capacity | ||||||
reserve | ||||||
shrink_to_fit | shrink_to_fit | |||||
Element access | operator[] | operator[] | operator[] | |||
at | at | at | ||||
front | front | front | front | front | ||
back | back | back | back | back | ||
data | data | |||||
Modifiers | fill | |||||
swap | swap | swap | swap | swap | swap | |
assign | assign | assign | ||||
push_front | ||||||
pop_front | ||||||
push_back | push_back | push_back | ||||
pop_back | pop_back | pop_back | ||||
pop_front | ||||||
pop | pop | |||||
top | ||||||
push | push | |||||
insert | insert | insert | ||||
erase | erase | erase | ||||
clear | clear | clear | ||||
emplace | emplace | emplace | emplace | emplace | ||
emplace_front | emplace_front | |||||
emplace_back | emplace_back | emplace_back |