Iterator library
De 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. |
La biblioteca iterador proporciona definiciones para cinco tipos de iteradores, así como rasgos iterador, adaptadores y funciones de utilidad .
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.
Contenido |
[editar] Categorías Iterator
Hay cinco tipos de iteradores:
InputIterator
, OutputIterator
, ForwardIterator
, BidirectionalIterator
y 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.
En lugar de estar definida por tipos específicos, cada categoría de iterador está definida por las operaciones que se pueden realizar sobre el mismo. Esta definición significa que cualquier tipo que soporta las operaciones necesarias puede ser utilizado como un iterador - por ejemplo, un puntero soporta todas las operaciones requeridas por
RandomAccessIterator
, por lo que un puntero puede ser utilizado en cualquier lugar un RandomAccessIterator
se espera .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.
Las cinco categorías iterador se pueden organizar en una jerarquía, donde las categorías iterador más poderosos (por ejemplo
RandomAccessIterator
) apoyar las operaciones de las categorías menos potentes (por ejemplo 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
proporciona una interfaz uniforme para las propiedades de un iterador 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. (clase de plantilla) | |
tipos de clase vacíos para indicar categorías 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. (clase) | |
el iterador de 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. (clase de plantilla) |
[editar] Adaptadores iterador
adaptador para iterador inverso orden transversal 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. (clase de plantilla) | |
(C++11) |
adaptador iterador que elimina referencias a una referencia de valor- 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. (clase de plantilla) |
(C++11) |
crea una std::move_iterator de tipo inferido a partir de la discusión 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. (función de plantilla) |
iterador adaptador para la inserción en el extremo de un 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. (clase de plantilla) | |
crea una std::back_insert_iterator de tipo inferido a partir de la discusión 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. (función de plantilla) | |
iterador adaptador para la inserción en la parte delantera de un contenedor 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. (clase de plantilla) | |
crea una std::front_insert_iterator de tipo inferido a partir de la discusión 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. (función de plantilla) | |
iterador adaptador para la inserción en un 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. (clase de plantilla) | |
crea una std::insert_iterator de tipo inferido a partir de la discusión 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. (función de plantilla) |
[editar] Iteradores Stream
iterador de entrada que se lee de 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. (clase de plantilla) | |
salida iterador que escribe en 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. (clase de plantilla) | |
iterador de entrada que se lee de 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. (clase de plantilla) | |
salida iterador que escribe en 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. (clase de plantilla) |
[editar] Operaciones iterador
Defined in header
<iterator> | |
avanza un iterador según distancia determinada 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. (función) | |
devuelve la distancia entre dos 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. (función) | |
(C++11) |
incrementar un 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. (función) |
(C++11) |
disminuir un 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. (función) |
[editar] Rango de acceso
Defined in header
<iterator> | |
(C++11) |
devuelve un iterador para el comienzo de un contenedor o 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. (función) |
(C++11) |
devuelve un iterador al extremo de un recipiente o 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. (función) |