unordered_map_max_size
unordered_map_max_size (std::unordered_map::max_size — 최대 크기)
std::unordered_map이 시스템이나 구현의 한계로 담을 수 있는 최대 원소 개수를 반환하는 멤버 함수예요.
출처: cppreference
본문
시그니처는 다음과 같아요.
size_type max_size() const noexcept;
시스템이나 라이브러리 구현의 한계로 컨테이너가 담을 수 있는 최대 원소 개수를 반환해요.
반환값
최대 원소 개수.
복잡도
상수(constant)예요.
참고
이 값은 많아야 std::numeric_limits<difference_type>::max()예요.
예제
#include <iostream>
#include <unordered_map>
int main()
{
std::unordered_map<char, char> q;
std::cout << "Maximum size: " << q.max_size() << '\n';
}