std::flat_set<Key,Compare,KeyContainer>:: max_size
|
(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 |
|
size_type max_size
(
)
const
noexcept
;
|
(C++23 이후) | |
시스템 또는 라이브러리 구현 제한으로 인해 컨테이너가 보유할 수 있는 최대 요소 수를 반환합니다. 즉, std:: distance ( begin ( ) , end ( ) ) 가장 큰 컨테이너에 대한 값입니다.
목차 |
매개변수
(없음)
반환값
최대 요소 수.
복잡도
상수.
참고 사항
이 값은 일반적으로 컨테이너 크기의 이론적 한계를 반영하며, 최대
std::
numeric_limits
<
difference_type
>
::
max
(
)
입니다. 런타임에는 컨테이너의 크기가 사용 가능한 RAM 양에 의해
max_size()
값보다 작은 값으로 제한될 수 있습니다.
예제
#include <iostream> #include <flat_set> #include <locale> int main() { std::flat_set<char> q; std::cout.imbue(std::locale("en_US.UTF-8")); std::cout << "Maximum size of a std::flat_set is " << q.max_size() << '\n'; }
가능한 출력:
Maximum size of a std::flat_set is 768,614,336,404,564,650
참고 항목
|
요소의 개수를 반환합니다
(public member function) |