Namespaces
Variants

std::hive<T,Allocator>::empty

cppreference.net에서

 
 
 
 
bool empty() const noexcept;
(C++26부터)

컨테이너에 요소가 없는지, 즉 begin() == end()인지 확인합니다.

반환값

true 컨테이너가 비어 있으면, false 그렇지 않으면.

복잡도

상수.

예제

#include <hive>
#include <iostream>

int main()
{
    std::cout << std::boolalpha;

    std::hive<int> bees;
    std::cout << "Initially, bees.empty() == " << bees.empty() << '\n';

    bees.insert(00);
    std::cout << "After adding elements, bees.empty() == " << bees.empty() << '\n';
}

출력:

Initially, bees.empty() == true
After adding elements, bees.empty() == false

참고 항목

요소의 수를 반환합니다
(공용 멤버 함수)
(C++17)
컨테이너가 비어 있는지 확인합니다
(함수 템플릿)