Expression | Return type | Operational semantics | Container | |
a.front() | reference; const_reference for constant a | *a.begin() | basic_string,
array,
deque,
forward_list,
list,
vector | |
a.back() | reference; const_reference for constant a | { auto tmp = a.end(); --tmp; return *tmp; } | basic_string,
array,
deque,
list,
vector | |
a.emplace_front(args) | reference | deque,
forward_list,
list | ||
a.emplace_back(args) | reference | deque,
list,
vector | ||
a.push_front(t) | void | deque,
forward_list,
list | ||
a.push_front(rv) | void | deque,
forward_list,
list | ||
a.push_back(t) | void | basic_string,
deque,
list,
vector | ||
a.push_back(rv) | void | basic_string,
deque,
list,
vector | ||
a.pop_front() | void | deque,
forward_list,
list | ||
a.pop_back() | void | basic_string,
deque,
list,
vector | ||
a[n] | reference; const_reference for constant a | *(a.begin() + n) | basic_string,
array,
deque,
vector | |
a.at(n) | reference; const_reference for constant a | *(a.begin() + n) | basic_string,
array,
deque,
vector |