std::flat_multiset<Key,Compare,KeyContainer>::size
Von cppreference.com
< cpp | container | flat multiset
| size_type size() const noexcept; |
(seit C++23) | |
Gibt die Anzahl der Elemente im Container-Adapter zurück. Entspricht: return c.size().
Inhalt |
[edit] Parameter
(keine)
[edit] Rückgabewert
Die Anzahl der Elemente im Container-Adapter.
[edit] Komplexität
Konstant.
[edit] Beispiel
Führen Sie diesen Code aus
#include <cassert> #include <flat_set> int main() { std::flat_multiset<int> nums{4, 2, 4, 2}; assert(nums.size() == 4); }
[edit] Siehe auch
| prüft, ob der Container-Adapter leer ist (public member function) | |
| (C++17)(C++20) |
gibt die Größe eines Containers oder Arrays zurück (Funktionsvorlage) |
| Gibt die maximal mögliche Anzahl von Elementen zurück (public member function) |