std::deque<T,Allocator>:: back
|
(C++17)
|
||||
| Sequence | ||||
|
(C++11)
|
||||
|
(C++26)
|
||||
|
(C++26)
|
||||
|
(C++11)
|
||||
| Associative | ||||
| Unordered associative | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Adaptors | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
| Views | ||||
|
(C++20)
|
||||
|
(C++23)
|
||||
| Tables | ||||
| Iterator invalidation | ||||
| Member function table | ||||
| Non-member function table |
| Member types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Non-member functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Deduction guides (C++17) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
reference back
(
)
;
|
(1) | (constexpr since C++26) |
|
const_reference back
(
)
const
;
|
(2) | (constexpr since C++26) |
컨테이너의 마지막 요소에 대한 참조를 반환합니다.
|
만약 empty() 가 true 라면, 동작은 정의되지 않습니다. |
(C++26 이전) |
|
만약 empty() 가 true 라면:
|
(C++26 이후) |
목차 |
반환값
마지막 요소에 대한 참조.
복잡도
상수.
참고 사항
비어 있지 않은 컨테이너 c 에 대해, 표현식 c. back ( ) 는 * std:: prev ( c. end ( ) ) 와 동등합니다.
예제
#include <cassert> #include <deque> int main() { std::deque<char> letters{'a', 'b', 'c', 'd'}; assert(letters.back() == 'd'); }
참고 항목
|
첫 번째 요소에 접근
(public member function) |
|
|
(C++11)
|
시작을 가리키는 역방향 반복자를 반환
(public member function) |
|
(C++11)
|
끝을 가리키는 반복자를 반환
(public member function) |