public member function
<unordered_set>

std::unordered_multiset::empty

bool empty() const noexcept;
Test whether container is empty
Returns a bool value indicating whether the unordered_multiset container is empty, i.e. whether its size is 0.

This function does not modify the content of the array in any way. To clear the content of an array object, member function unordered_multiset::clear exists.

Parameters

none

Return Value

true if the container size is 0, false otherwise.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
// unordered_multiset::empty
#include <iostream>
#include <string>
#include <unordered_set>

int main ()
{
  std::unordered_multiset<std::string> first;
  std::unordered_multiset<std::string> second = {"mom","dad","son","daughter","son"};
  std::cout << "first " << (first.empty() ? "is empty" : "is not empty" ) << std::endl;
  std::cout << "second " << (second.empty() ? "is empty" : "is not empty" ) << std::endl;
  return 0;
}


Output:
first is empty
second is not empty

Complexity

Constant.

Iterator validity

No changes.

See also

  • 1793521592 2018-02-23
  • 2864591591 2018-02-23
  • 6167231590 2018-02-23
  • 3669201589 2018-02-23
  • 7946381588 2018-02-23
  • 8957701587 2018-02-23
  • 3891941586 2018-02-23
  • 6039851585 2018-02-23
  • 2573991584 2018-02-23
  • 7728781583 2018-02-23
  • 3731582 2018-02-23
  • 1007451581 2018-02-22
  • 8908121580 2018-02-22
  • 141161579 2018-02-22
  • 9421578 2018-02-22
  • 2826901577 2018-02-22
  • 3647361576 2018-02-22
  • 5717551575 2018-02-22
  • 523811574 2018-02-22
  • 6439871573 2018-02-22