std::forward_list<T,Allocator>:: pop_front
From cppreference.net
<
cpp
|
container
|
forward list
C++
Containers library
|
(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 |
std::forward_list
| Member functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Non-member functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Deduction guides (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
void
pop_front
(
)
;
|
(C++11부터)
(C++26부터 constexpr) |
|
컨테이너의 첫 번째 요소를 제거합니다.
|
만약 empty() 이 true 라면, 동작은 정의되지 않습니다. |
(C++26 이전) |
|
만약 empty() 이 true 라면:
|
(C++26 이후) |
삭제된 요소에 대한 참조와 반복자는 무효화됩니다.
복잡도
상수.
예제
이 코드 실행
#include <forward_list> #include <iostream> int main() { std::forward_list<char> chars{'A', 'B', 'C', 'D'}; for (; !chars.empty(); chars.pop_front()) std::cout << "chars.front(): '" << chars.front() << "'\n"; }
출력:
chars.front(): 'A' chars.front(): 'B' chars.front(): 'C' chars.front(): 'D'
참고 항목
|
시작 부분에 요소를 삽입합니다
(public member function) |
|
|
첫 번째 요소에 접근합니다
(public member function) |