Espacios de nombres
Variantes
Acciones

std::reverse_iterator

De cppreference.com
< cpp‎ | iterator

 
 
Biblioteca Iterator
Primitivas iterador
Original:
Iterator primitives
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iterator_traits
input_iterator_tag
output_iterator_tag
forward_iterator_tag
bidirectional_iterator_tag
random_access_iterator_tag
iterator
Adaptadores iterador
Original:
Iterator adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
reverse_iterator
Iteradores Stream
Original:
Stream iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istream_iterator
ostream_iterator
istreambuf_iterator
ostreambuf_iterator
Operaciones iterador
Original:
Iterator operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
advance
distance
prev(C++11)
next(C++11)
Rango de acceso
Original:
Range access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
begin(C++11)
end(C++11)
 
std::reverse_iterator
Las funciones miembro
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.
reverse_iterator::reverse_iterator
reverse_iterator::operator=
reverse_iterator::base
reverse_iterator::operator*
reverse_iterator::operator->
reverse_iterator::operator[]
reverse_iterator::operator++
reverse_iterator::operator+
reverse_iterator::operator+=
reverse_iterator::operator--
reverse_iterator::operator-
reverse_iterator::operator-=
Terceros funciones
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator==
operator!=
operator<
operator>
operator+
operator-
 
Defined in header <iterator>
template< class Iterator >

class reverse_iterator : public std::iterator<
                           typename std::iterator_traits<Iterator>::iterator_category,
                           typename std::iterator_traits<Iterator>::value_type,
                           typename std::iterator_traits<Iterator>::difference_type,
                           typename std::iterator_traits<Iterator>::pointer,

                           typename std::iterator_traits<Iterator>::reference >
std::reverse_iterator es un adaptador iterador que invierte la dirección de un iterador dado. En otras palabras, cuando se proporciona un iterador bidireccional, std::reverse_iterator produce un iterador de nuevo que se mueve desde el final hasta el principio de la secuencia definida por el iterador bidireccional subyacente .
Original:
std::reverse_iterator is an iterator adaptor that reverses the direction of a given iterator. In other words, when provided with a bidirectional iterator, std::reverse_iterator produces a new iterator that moves from the end to the beginning of the sequence defined by the underlying bidirectional iterator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Para un iterador inverso r construido a partir de un i iterador, el &*r == &*(i-1) relación siempre es cierto, por lo que un iterador inverso construido a partir de una desreferencia un iterador-past-the-end hasta el último elemento de una secuencia .
Original:
For a reverse iterator r constructed from an iterator i, the relationship &*r == &*(i-1) is always true; thus a reverse iterator constructed from a one-past-the-end iterator dereferences to the last element in a sequence.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Este es el iterador devuelto por las funciones miembro rbegin() y rend() de los contenedores de la biblioteca estándar .
Original:
This is the iterator returned by member functions rbegin() and rend() of the standard library containers.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Tipos de miembros

Miembro de tipo
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
iterator_type Iterator
difference_type std::iterator_traits<Iterator>::difference_type
pointer std::iterator_traits<Iterator>::pointer
reference std::iterator_traits<Iterator>::reference

[editar] Las funciones miembro

construye un nuevo adaptador iterador
Original:
constructs a new iterator adaptor
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
asigna otro iterador
Original:
assigns another iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
accede el iterador subyacente
Original:
accesses the underlying iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
accede al elemento en punta-a
Original:
accesses the pointed-to element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
obtiene rvalue referencia al elemento indexado
Original:
obtains rvalue reference to indexed element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
avances o disminuye el iterador
Original:
advances or decrements the iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]

[editar] Objetos miembros

Persona
Original:
Member name
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
current (protegida)
una copia de la base de iterador ()
Original:
a copy of the base() iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Además del valor actual del iterador subyacente, una implementación típica de std::reverse_iterator mantiene una copia de decrementa el iterador subyacente, que se utiliza en la eliminación de referencias .
Original:
In addition to the current value of the underlying iterator, a typical implementation of std::reverse_iterator holds a decremented copy of the underlying iterator, which is used in dereferencing.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Terceros funciones

compara los iteradores subyacentes
Original:
compares the underlying 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 de plantilla) [edit]
avanza el iterador
Original:
advances the 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 de plantilla) [edit]
calcula la distancia entre dos adaptadores iterador
Original:
computes the distance between two iterator adaptors
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) [edit]

Inherited from std::iterator

Member types

Miembro de tipo
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
value_type  std::iterator_traits<Iterator>::value_type
difference_type  std::iterator_traits<Iterator>::difference_type
pointer  std::iterator_traits<Iterator>::pointer
reference  std::iterator_traits<Iterator>::reference
iterator_category  std::iterator_traits<Iterator>::iterator_category

[editar] Ejemplo

#include <iostream>
#include <string>
#include <iterator>
 
int main()
{
    std::string s = "Hello, world";
    std::reverse_iterator<std::string::iterator> r = s.rbegin();
    r[7] = 'O'; // replaces 'o' with 'O' 
    r += 7; // iterator now points at 'O'
    std::string rev(r, s.rend());
    std::cout << rev << '\n';
}

Output:

OlleH

[editar] Ver también

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