Iterator library
Da cppreference.com.
< cpp
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
La biblioteca iteratore fornisce una definizione dei cinque tipi di iteratori, nonché tratti iteratore, adattatori, e funzioni di utilità.
Original:
The iterator library provides definitions for five kinds of iterators as well as iterator traits, adapters, and utility functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica]Categorie di iteratori
Ci sono cinque tipi di iteratori:
InputIterator
, OutputIterator
, ForwardIterator
, BidirectionalIterator
e RandomAccessIterator
.Original:
There are five kinds of iterators:
InputIterator
, OutputIterator
, ForwardIterator
, BidirectionalIterator
, and RandomAccessIterator
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Invece di essere definita da specifici tipi, ciascuna categoria di iteratore è definito dalle operazioni che possono essere eseguite su di esso. Questa definizione significa che qualsiasi tipo che supporta le operazioni necessarie possono essere utilizzati come un iteratore - per esempio, un puntatore supporta tutte le operazioni richieste da
RandomAccessIterator
, quindi un puntatore può essere utilizzato ovunque un RandomAccessIterator
è previsto.Original:
Instead of being defined by specific types, each category of iterator is defined by the operations that can be performed on it. This definition means that any type that supports the necessary operations can be used as an iterator -- for example, a pointer supports all of the operations required by
RandomAccessIterator
, so a pointer can be used anywhere a RandomAccessIterator
is expected.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Le cinque categorie iteratore possono essere organizzati in una gerarchia, in cui le categorie iteratore più potenti (ad es
RandomAccessIterator
) supportano le operazioni di categorie meno potenti (ad esempio InputIterator
):Original:
The five iterator categories can be organized into a hierarchy, where more powerful iterator categories (e.g.
RandomAccessIterator
) support the operations of less powerful categories (e.g. InputIterator
):The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Iterator category | Defined operations | |||
---|---|---|---|---|
RandomAccessIterator | BidirectionalIterator | ForwardIterator | InputIterator |
|
OutputIterator |
| |||
| ||||
| ||||
|
[modifica]Primitive iteratori
fornisce un'interfaccia uniforme per le proprietà di un iteratore Original: provides uniform interface to the properties of an iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
tipologie di classi vuote per indicare categorie di iteratori Original: empty class types used to indicate iterator categories The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
l'iteratore di base Original: the basic iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
[modifica]Adattatori iteratori
Adattatore iteratore per il reverse-ordine di attraversamento Original: iterator adaptor for reverse-order traversal The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
(C++11) | Adattatore iteratore che dereferenziazioni a un riferimento rvalue Original: iterator adaptor which dereferences to an rvalue reference The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) | crea un std::move_iterator di tipo derivato dalla tesi Original: creates a std::move_iterator of type inferred from the argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) |
Adattatore iteratore per inserimento alla fine di un contenitore Original: iterator adaptor for insertion at the end of a container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
crea un std::back_insert_iterator di tipo derivato dalla tesi Original: creates a std::back_insert_iterator of type inferred from the argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) | |
Adattatore iteratore per l'inserimento nella parte anteriore di un contenitore Original: iterator adaptor for insertion at the front of a container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
crea un std::front_insert_iterator di tipo derivato dalla tesi Original: creates a std::front_insert_iterator of type inferred from the argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) | |
Adattatore iteratore per l'inserimento in un contenitore Original: iterator adaptor for insertion into a container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
crea un std::insert_iterator di tipo derivato dalla tesi Original: creates a std::insert_iterator of type inferred from the argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) |
[modifica]Flusso iteratori
iteratore di input che legge da std::basic_istream Original: input iterator that reads from std::basic_istream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
uscita iteratore che scrive std::basic_ostream Original: output iterator that writes to std::basic_ostream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
iteratore di input che legge da std::basic_streambuf Original: input iterator that reads from std::basic_streambuf The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
uscita iteratore che scrive std::basic_streambuf Original: output iterator that writes to std::basic_streambuf The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
[modifica]Operazioni di iteratori
Definizione nell'header <iterator> | |
avanza di un iteratore per distanza data Original: advances an iterator by given distance The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
restituisce la distanza tra due iteratori Original: returns the distance between two iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
(C++11) | incrementare un iteratore Original: increment an iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |
(C++11) | decrementare un iteratore Original: decrement an iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |
[modifica]Intervallo accesso
Definizione nell'header <iterator> | |
(C++11) | restituisce un iteratore all'inizio di un contenitore o matrice Original: returns an iterator to the beginning of a container or array The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |
(C++11) | ritorna un iteratore alla fine di un contenitore o matrice Original: returns an iterator to the end of a container or array The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |