GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • TUTORIALS
  • REFERENCE
  • ARTICLES
  • FORUM
  • C library:
  • <cassert> (assert.h)
  • <cctype> (ctype.h)
  • <cerrno> (errno.h)
  • <cfenv> (fenv.h)
  • <cfloat> (float.h)
  • <cinttypes> (inttypes.h)
  • <ciso646> (iso646.h)
  • <climits> (limits.h)
  • <clocale> (locale.h)

This view

  • Original page
  • New address

GeezerVison is showing cplusplus.com — std::unordered_multimap::empty

  • TUTORIALS
  • REFERENCE
  • ARTICLES
  • FORUM

C++

  • Tutorials
  • Reference
  • Articles
  • Forum

Reference

  • C library:

    • <cassert> (assert.h)
    • <cctype> (ctype.h)
    • <cerrno> (errno.h)
    • C++11
      <cfenv> (fenv.h)
    • <cfloat> (float.h)
    • C++11
      <cinttypes> (inttypes.h)
    • <ciso646> (iso646.h)
    • <climits> (limits.h)
    • <clocale> (locale.h)
    • <cmath> (math.h)
    • <csetjmp> (setjmp.h)
    • <csignal> (signal.h)
    • <cstdarg> (stdarg.h)
    • C++11
      <cstdbool> (stdbool.h)
    • <cstddef> (stddef.h)
    • C++11
      <cstdint> (stdint.h)
    • <cstdio> (stdio.h)
    • <cstdlib> (stdlib.h)
    • <cstring> (string.h)
    • C++11
      <ctgmath> (tgmath.h)
    • <ctime> (time.h)
    • C++11
      <cuchar> (uchar.h)
    • <cwchar> (wchar.h)
    • <cwctype> (wctype.h)
  • Containers:

    • C++11
      <array>
    • <deque>
    • C++11
      <forward_list>
    • <list>
    • <map>
    • <queue>
    • <set>
    • <stack>
    • C++11
      <unordered_map>
    • C++11
      <unordered_set>
    • <vector>
  • Input/Output:

    • <fstream>
    • <iomanip>
    • <ios>
    • <iosfwd>
    • <iostream>
    • <istream>
    • <ostream>
    • <sstream>
    • <streambuf>
  • Multi-threading:

    • C++11
      <atomic>
    • C++11
      <condition_variable>
    • C++11
      <future>
    • C++11
      <mutex>
    • C++11
      <thread>
  • Other:

    • <algorithm>
    • <bitset>
    • C++11
      <chrono>
    • C++11
      <codecvt>
    • <complex>
    • <exception>
    • <functional>
    • C++11
      <initializer_list>
    • <iterator>
    • <limits>
    • <locale>
    • <memory>
    • <new>
    • <numeric>
    • C++11
      <random>
    • C++11
      <ratio>
    • C++11
      <regex>
    • <stdexcept>
    • <string>
    • C++11
      <system_error>
    • C++11
      <tuple>
    • C++11
      <type_traits>
    • C++11
      <typeindex>
    • <typeinfo>
    • <utility>
    • <valarray>

<unordered_map>

  • C++11
    unordered_map
  • C++11
    unordered_multimap

unordered_multimap

  • C++11
    unordered_multimap::~unordered_multimap
  • C++11
    unordered_multimap::unordered_multimap
  • member functions

    • C++11
      unordered_multimap::begin
    • C++11
      unordered_multimap::bucket
    • C++11
      unordered_multimap::bucket_count
    • C++11
      unordered_multimap::bucket_size
    • C++11
      unordered_multimap::cbegin
    • C++11
      unordered_multimap::cend
    • C++11
      unordered_multimap::clear
    • C++11
      unordered_multimap::count
    • C++11
      unordered_multimap::emplace
    • C++11
      unordered_multimap::emplace_hint
    • C++11
      unordered_multimap::empty
    • C++11
      unordered_multimap::end
    • C++11
      unordered_multimap::equal_range
    • C++11
      unordered_multimap::erase
    • C++11
      unordered_multimap::find
    • C++11
      unordered_multimap::get_allocator
    • C++11
      unordered_multimap::hash_function
    • C++11
      unordered_multimap::insert
    • C++11
      unordered_multimap::key_eq
    • C++11
      unordered_multimap::load_factor
    • C++11
      unordered_multimap::max_bucket_count
    • C++11
      unordered_multimap::max_load_factor
    • C++11
      unordered_multimap::max_size
    • C++11
      unordered_multimap::operator=
    • C++11
      unordered_multimap::rehash
    • C++11
      unordered_multimap::reserve
    • C++11
      unordered_multimap::size
    • C++11
      unordered_multimap::swap
  • non-member overloads

    • C++11
      operators (unordered_multimap)
    • C++11
      swap (unordered_multimap)
  • Reference
  • <unordered_map>
  • unordered_multimap
  • empty
public member function
<unordered_map>

std::unordered_multimap::empty

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

This function does not modify the content of the container in any way. To clear the content of an array object, member function unordered_multimap::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
// unordered_multimap::empty
#include <iostream>
#include <unordered_map>

int main ()
{
  std::unordered_multimap<int,int> first;
  std::unordered_multimap<int,int> second = {{1,10},{2,20},{1,15}};
  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

unordered_multimap::clear
Clear content (public member function)
unordered_multimap::erase
Erase elements (public member function)
Home page | Privacy policy
© cplusplus.com, 2000-2026 - All rights reserved - v3.3.4s
Spotted an error? contact us
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.