Iterator library
Da cppreference.com
< cpp
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
A biblioteca iterator fornece definições para cinco tipos de iteradores, bem como traços de iterador, adaptadores, e funções utilitárias.
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.
Índice |
[editar] Categorias Iterator
Existem cinco tipos de iteradores:
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.
Em vez de ser definida por tipos específicos, cada categoria de iterador é definido pelas operações que podem ser executadas no mesmo. Esta definição significa que qualquer tipo que suporta as operações necessárias podem ser usados como um agente iterativo - por exemplo, um ponteiro suporta todas as operações necessárias para
RandomAccessIterator
, portanto, um ponteiro pode ser usado em qualquer lugar uma RandomAccessIterator
é esperado.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.
As cinco categorias de iterador podem ser organizados em uma hierarquia, onde as categorias de iterador mais poderosos (por exemplo
RandomAccessIterator
) apoiar as operações de categorias menos potentes (por exemplo 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
|
| |||
| ||||
| ||||
|
[editar] Primitivas iterador
fornece uma interface uniforme para as propriedades de uma iteração 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. (modelo de classe) | |
tipos de classe vazios usados para indicar categorias iterador 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) | |
o iterador básica 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. (modelo de classe) |
[editar] Adaptadores de iterador
adaptador iterador para inverter ordem de transferência 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. (modelo de classe) | |
(C++11) |
adaptador iterador que dereferences a uma referência de 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. (modelo de classe) |
(C++11) |
cria um std::move_iterator do tipo inferido a partir do argumento 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. (modelo de função) |
adaptador iterador para inserção na extremidade de um recipiente 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. (modelo de classe) | |
cria um std::back_insert_iterator do tipo inferido a partir do argumento 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. (modelo de função) | |
adaptador iterador para inserção na parte da frente de um recipiente 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. (modelo de classe) | |
cria um std::front_insert_iterator do tipo inferido a partir do argumento 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. (modelo de função) | |
adaptador iterador para inserção dentro de um recipiente 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. (modelo de classe) | |
cria um std::insert_iterator do tipo inferido a partir do argumento 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. (modelo de função) |
[editar] Iteradores fluxo
iterador de entrada que lê 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. (modelo de classe) | |
iterador de saída que escreve para 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. (modelo de classe) | |
iterador de entrada que lê 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. (modelo de classe) | |
iterador de saída que escreve para 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. (modelo de classe) |
[editar] Operações iterador
Defined in header
<iterator> | |
avanços de um iterador por determinada distância 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. (função) | |
retorna a distância entre dois iteradores 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. (função) | |
(C++11) |
incrementar um iterador 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. (função) |
(C++11) |
decrementar um iterador 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. (função) |
[editar] Variar de acesso
Defined in header
<iterator> | |
(C++11) |
retorna um iterador para o início de um recipiente ou de matriz 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. (função) |
(C++11) |
devolve uma iteração com a extremidade de um recipiente ou de matriz 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. (função) |