flat_multimap_size
flat_multimap_size (std::flat_multimap::size — 원소 개수)
std::flat_multimap 컨테이너 어댑터가 담고 있는 원소의 개수를 반환하는 멤버 함수예요.
출처: cppreference
본문
시그니처는 다음과 같아요.
size_type size() const noexcept; // (since C++23)
컨테이너 어댑터의 원소 개수를 반환해요. return c.keys.size();와 동등해요.
반환값
컨테이너 어댑터의 원소 개수.
복잡도
상수(constant)예요.
예제
#include <cassert>
#include <flat_map>
int main()
{
std::flat_multimap<int, char> nums{{1, 'a'}, {1, 'b'}, {2, 'c'}, {2, 'd'}};
assert(nums.size() == 4);
}
함께 보기
empty: 컨테이너 어댑터가 비어 있는지 확인해요 (공개 멤버 함수)max_size: 가능한 최대 원소 개수를 반환해요 (공개 멤버 함수)