std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer>:: begin, std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer>:: cbegin
From cppreference.net
<
cpp
|
container
|
flat multimap
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_multimap
| Member types | ||||
| Member functions | ||||
| Non-member functions | ||||
| Helper classes | ||||
| Tags | ||||
| Deduction guides | ||||
|
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() 와 같을 것입니다.
목차 |
반환값
첫 번째 요소에 대한 반복자.
복잡도
상수.
예제
이 코드 실행
#include <iostream> #include <flat_map> int main() { std::flat_multimap<int, int> map{{4, 13}, {9, 94}, {1, 19}, {4, 42}}; for (auto it = map.cbegin(); it != map.cend(); ++it) std::cout << '[' << it->first << "] = " << it->second << '\n'; // std::multimap의 양방향 반복자와 달리, std::flat_multimap의 // 반복자는 임의 접근(random-access)이므로 operator[]와 함께 사용할 수 있습니다: auto it = map.cbegin(); assert(it[1] == 19); assert(it[4] == 13); assert(it[4] == 42); assert(it[9] == 94); }
출력:
[1] = 19 [4] = 13 [4] = 42 [9] = 94
참고 항목
|
끝을 가리키는 반복자를 반환합니다
(public member function) |
|
|
(C++11)
(C++14)
|
컨테이너나 배열의 시작을 가리키는 반복자를 반환합니다
(function template) |