std::set::begin, std::set::cbegin
Da cppreference.com.
iterator begin(); |
(fino al c++11) | |
iterator begin() noexcept; |
(dal C++11) | |
const_iterator begin() const; |
(fino al c++11) | |
const_iterator begin() const noexcept; |
(dal C++11) | |
const_iterator cbegin() const noexcept; |
||
Restituisce un iteratore al primo elemento del container.
Se il container è vuoto, l'iteratore restituito sarà uguale a end().
Parametri
(nessuno)
Valore restituito
Iteratore al primo elemento
Complessità
Costante Template:cpp/container/constant iterator note
Example
#include <set>
#include <iostream>
int main() {
std::set<int> set = { 6, 1, 3, 4, 2, 5 };
for (auto it = set.begin(); it != set.end(); ++it)
std::cout << *it << "\n";
}
Possible output:
1
2
3
4
5
6
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) | |