Namespaces
Variants

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

From cppreference.com
 
 
 
 
bool empty() const noexcept;
(since C++26)

Checks if the container has no elements, i.e., whether begin() == end().

Return value

true if the container is empty, false otherwise.

Complexity

Constant.

Example

#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';
}

Output:

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

See also

returns the number of elements
(public member function) [edit]
(C++17)
checks whether the container is empty
(function template) [edit]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.