std::unordered_multiset<Key,Hash,KeyEqual,Allocator>:: end, std::unordered_multiset<Key,Hash,KeyEqual,Allocator>:: cend
From de.cppreference.net
<
cpp
|
container
|
unordered multiset
|
iterator end
(
)
noexcept
;
|
(1) |
(seit C++11)
(constexpr seit C++26) |
|
const_iterator end
(
)
const
noexcept
;
|
(2) |
(seit C++11)
(constexpr seit C++26) |
|
const_iterator cend
(
)
const
noexcept
;
|
(3) |
(seit C++11)
(constexpr seit C++26) |
Gibt einen Iterator zurück, der hinter dem letzten Element von * this liegt.
Dieser zurückgegebene Iterator fungiert lediglich als Sentinel. Es ist nicht garantiert, dass er dereferenzierbar ist.
Inhaltsverzeichnis |
Rückgabewert
Iterator hinter dem letzten Element.
Komplexität
Konstante.
Hinweise
Da sowohl
iterator
als auch
const_iterator
konstante Iteratoren sind (und tatsächlich derselbe Typ sein können), ist es nicht möglich, die Elemente des Containers über einen von diesen Memberfunktionen zurückgegebenen Iterator zu verändern.
Beispiel
Diesen Code ausführen
#include <iostream> #include <iterator> #include <string> #include <unordered_set> int main() { const std::unordered_multiset<std::string> words = { "some", "words", "to", "count", "count", "these", "words" }; for (auto it = words.begin(); it != words.end(); ) { auto count = words.count(*it); std::cout << *it << ":\t" << count << '\n'; std::advance(it, count); // all count elements have equivalent keys } }
Mögliche Ausgabe:
some: 1 words: 2 to: 1 count: 2 these: 1
Siehe auch
|
gibt einen Iterator zum Anfang zurück
(public member function) |
|
|
(C++11)
(C++14)
|
gibt einen Iterator zum Ende eines Containers oder Arrays zurück
(function template) |