std::unordered_multiset::begin, std::unordered_multiset::cbegin
Da cppreference.com.
< cpp | container | unordered multiset
iterator begin() noexcept; |
||
const_iterator begin() const noexcept; |
||
const_iterator cbegin() const noexcept; |
||
Restituisce un iteratore al primo elemento del container.
Se il container è vuoto, l'iteratore restituito sarà uguale a end().
Indice |
[modifica] Parametri
(nessuno)
[modifica] Valore restituito
Iteratore al primo elemento
[modifica] Complessità
Costante Template:cpp/container/constant iterator note
[modifica] Example
#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 cnt = words.count(*it); std::cout << *it << ":\t" << cnt << '\n'; std::advance(it, cnt); // all cnt elements have equivalent keys } }
Possible output:
some: 1 words: 2 to: 1 count: 2 these: 1
[modifica] Vedi anche
restituisce un iteratore fino alla fine Original: returns an iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |