flat_multimap::empty

flat_multimap::empty (비어 있는지 확인)

flat_multimap에 요소가 비어 있는지 확인하는 멤버 함수예요. 상수 시간에 동작해요. <flat_map> 헤더, C++23부터.

출처: cppreference

본문

empty()는 flat_multimap에 요소 없음(begin() == end())인지 확인해요.

bool empty() const noexcept;
  • 반환 값: 비어 있으면 true, 아니면 false.
  • 복잡도: 상수 시간.
std::flat_multimap<std::string, int> m;
bool e = m.empty();   // true
m.emplace("a", 1);
e = m.empty();        // false

요소 존재 여부를 가볍게 확인할 때 쓰는 함수예요. 벡터 기반이라 크기 필드로 즉시 판정돼요.

더 알아보기 (Learn more)

cppreference