flat_multiset_size

flat_multiset_size (std::flat_multiset::size — 원소 개수)

std::flat_multiset 컨테이너 어댑터가 담고 있는 원소의 개수를 반환하는 멤버 함수예요.

출처: cppreference

본문

시그니처는 다음과 같아요.

size_type size() const noexcept;   // (since C++23)

컨테이너 어댑터의 원소 개수를 반환해요. return c.size();와 동등해요.

반환값

컨테이너 어댑터의 원소 개수.

복잡도

상수(constant)예요.

예제

#include <cassert>
#include <flat_set>
int main()
{
    std::flat_multiset<int> nums{4, 2, 4, 2};
    assert(nums.size() == 4);
}

함께 보기

  • empty: 컨테이너 어댑터가 비어 있는지 확인해요 (공개 멤버 함수)
  • max_size: 가능한 최대 원소 개수를 반환해요 (공개 멤버 함수)

더 알아보기 (Learn more)

cppreference