◐ Shell
clean mode source ↗

std::unordered_multimap::size – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

size_type size() const;

(seit C++11)

Returns the number of elements in the container, i.e. std::distance(begin(), end()).

Parameter

(None)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Rückgabewert

die Anzahl der Elemente in dem Behälter

Original:

the number of elements in the container

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Ausnahmen

Komplexität

Constant

Beispiel

The following code uses size to display the number of elements in a std::unordered_multimap<int>:

#include <unordered_multimap>
#include <iostream>
 
int main()
{
    std::unordered_multimap<int, char> nums {{1, 'a'}, {3, 'b'}, {5, 'c'}, {7, 'd'}};
 
    std::cout << "nums contains " << nums.size() << " elements.\n";
}

Output:

nums contains 4 elements.

Siehe auch

prüft, ob der Container leer ist

Original:

checks whether the container is empty

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(öffentliche Elementfunktion) [edit]

gibt die maximal mögliche Anzahl von Elementen

Original:

returns the maximum possible number of elements

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(öffentliche Elementfunktion) [edit]