std::flat_set<Key,Compare,KeyContainer>:: begin, std::flat_set<Key,Compare,KeyContainer>:: cbegin
From cppreference.net
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::flat_set
|
iterator begin
(
)
noexcept
;
|
(1) |
(C++23부터)
(C++26부터 constexpr) |
|
const_iterator begin
(
)
const
noexcept
;
|
(2) |
(C++23부터)
(C++26부터 constexpr) |
|
const_iterator cbegin
(
)
const
noexcept
;
|
(3) |
(C++23부터)
(C++26부터 constexpr) |
* this 의 첫 번째 요소에 대한 반복자를 반환합니다.
만약 * this 가 비어 있다면, 반환된 반복자는 end() 와 같을 것입니다.
목차 |
반환값
첫 번째 요소에 대한 반복자.
복잡도
상수.
참고 사항
iterator
와
const_iterator
모두 상수 반복자이므로(실제로 동일한 타입일 수 있음), 이러한 멤버 함수들이 반환하는 반복자를 통해 컨테이너 요소들을 변경하는 것은 불가능합니다.
예제
이 코드 실행
#include <algorithm> #include <flat_set> #include <iostream> int main() { std::flat_set<int> set{3, 1, 4, 1, 5, 9, 2, 6, 5}; std::for_each(set.cbegin(), set.cend(), [](int x) { std::cout << x << ' '; }); std::cout << '\n'; }
출력:
1 2 3 4 5 6 9
참고 항목
|
끝을 가리키는 반복자를 반환합니다
(public member function) |
|
|
(C++11)
(C++14)
|
컨테이너나 배열의 시작을 가리키는 반복자를 반환합니다
(function template) |