Namensräume
Varianten
Aktionen

std::reverse_iterator

Aus cppreference.com
< cpp‎ | iterator

 
 
Iterator Bibliothek
Iterator Primitiven
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
Iterator Adaptern
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
Stream-Iteratoren
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
Iterator Operationen
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)
Reichen Zugang
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
Member-Funktionen
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-=
Non-Member-Funktionen
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 ist ein Iterator-Adapter, die die Richtung eines gegebenen Iterator umkehrt. Mit anderen Worten, wenn es mit einem bidirektionalen Iterator vorgesehen ist, erzeugt einen neuen std::reverse_iterator Iterator, der vom Ende bewegt sich zum Beginn der Sequenz von der zugrundeliegenden bidirektionalen Iterator definiert .
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.
Für einen umgekehrten Iterator r aus einem Iterator i gebaut, ist die Beziehung &*r == &*(i-1) immer wahr, so ein Reverse-Iterator hergestellt aus einem ein-past-the-end iterator dereferences auf das letzte Element in einer Sequenz .
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.
Dies ist der Iterator um Elementfunktionen rbegin() und rend() der Standard-Bibliothek Container zurückgegeben .
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.

Inhaltsverzeichnis

[Bearbeiten] Mitglied Typen

Mitglied Typ
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

[Bearbeiten] Member-Funktionen

baut einen neuen Iterator-Adapter
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.

(öffentliche Elementfunktion) [edit]
ordnet eine andere Iterator
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.

(öffentliche Elementfunktion) [edit]
greift auf die zugrunde liegenden Iterator
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.

(öffentliche Elementfunktion) [edit]
greift auf die spitzen-to-Element
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.

(öffentliche Elementfunktion) [edit]
erhält rvalue Bezug auf indizierte Element
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.

(öffentliche Elementfunktion) [edit]
Vorschüsse oder dekrementiert den Iterator
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.

(öffentliche Elementfunktion) [edit]

[Bearbeiten] Mitglied widerspricht

Member name
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 (geschützt)
eine Kopie des base () Iterator
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.
Zusätzlich zu dem aktuellen Wert des zugrundeliegenden Iterator, hält eine typische Implementierung eines std::reverse_iterator dekrementiert Kopie des zugrundeliegenden Iterator, der in Dereferenzieren verwendet wird .
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.

[Bearbeiten] Non-Member-Funktionen

vergleicht die zugrunde liegenden Iteratoren
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.

(Funktions-Template) [edit]
Fortschritte der Iterator
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.

(Funktions-Template) [edit]
berechnet den Abstand zwischen zwei Iterator Adaptern
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.

(Funktions-Template) [edit]

Inherited from std::iterator

Member types

Mitglied Typ
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

[Bearbeiten] Beispiel

#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

[Bearbeiten] Siehe auch

die grundlegende Iterator
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.

(Klassen-Template) [edit]