Namespace
Varianti

std::unordered_set::begin, std::unordered_set::cbegin

Da cppreference.com.
 
 
 
std :: unordered_set
Membri funzioni
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_set::unordered_set
unordered_set::~unordered_set
unordered_set::operator=
unordered_set::get_allocator
Iteratori
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_set::begin
unordered_set::cbegin
unordered_set::end
unordered_set::cend
Capacità
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_set::erase
unordered_set::size
unordered_set::max_size
Modificatori
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_set::clear
unordered_set::insert
unordered_set::emplace
unordered_set::emplace_hint
unordered_set::erase
unordered_set::swap
Lookup
Original:
Lookup
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_set::count
unordered_set::find
unordered_set::equal_range
Benna interfaccia
Original:
Bucket interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_set::begin2
unordered_set::end2
unordered_set::bucket_count
unordered_set::max_bucket_count
unordered_set::bucket_size
unordered_set::bucket
Politica di Hash
Original:
Hash policy
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_set::load_factor
unordered_set::max_load_factor
unordered_set::rehash
unordered_set::reserve
Osservatori
Original:
Observers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_set::hash_function
unordered_set::key_eq
 
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().

range-begin-end.svg

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 <unordered_set>
 
struct Point { double x, y; };
 
int main() {
    Point pts[3] = { {1, 0}, {2, 0}, {3, 0} };
 
    //points is a set containing the addresses of points
    std::unordered_set<Point *> points = { pts, pts + 1, pts + 2 };
 
    //Change each y-coordinate of (i, 0) from 0 into i^2 and print the point
    for(auto iter = points.begin(); iter != points.end(); ++iter){
        (*iter)->y = ((*iter)->x) * ((*iter)->x); //iter is a pointer-to-Point*
        std::cout << "(" << (*iter)->x << ", " << (*iter)->y << ") ";
    }
    std::cout << '\n';
 
    //Now using the range-based for loop, we increase each y-coordinate by 10
    for(Point * i : points) {
        i->y += 10;
        std::cout << "(" << i->x << ", " << i->y << ") ";
    }
}

Possible output:

(3, 9) (1, 1) (2, 4) 
(3, 19) (1, 11) (2, 14)

[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) [edit]