std::unordered_map<Key,T,Hash,KeyEqual,Allocator>::size
cppreference.net에서 가져옴
size_type size() const noexcept;
|
(C++11부터) | |
컨테이너의 요소 수, 즉 std::distance(begin(), end())을 반환합니다.
반환값
std:: distance ( begin ( ) , end ( ) )
복잡도
상수.
예제
이 코드 실행
#include <cassert> #include <unordered_map> int main() { std::unordered_map<int, char> nums{{1, 'a'}, {1, 'b'}, {2, 'c'}, {2, 'd'}}; assert(nums.size() == 2); }
참고 항목
|
컨테이너가 비어 있는지 확인합니다
(public member function) |
|
|
가능한 최대 요소 수를 반환합니다
(public member function) |
|
|
(C++17)
(C++20)
|
컨테이너나 배열의 크기를 반환합니다
(function template) |