Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Standard C++ Library Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

reverse_iterator

Module:  Standard C++ Library   Library:  Iterators


Does not inherit

Local Index

No Entries

Summary

An iterator adaptor that traverses a collection backwards.

Synopsis

#include <iterator>

namespace std {
  template <class Iterator>
  class reverse_iterator;
}

Description

The class template reverse_iterator adapts any random access iterator or bidirectional_iterator to facilitate the traversal of collections in the opposite direction. The fundamental relationship between a reverse iterator and its corresponding iterator i is established by the identity:

This mapping is necessary because, while an iterator past the end of a sequence is still valid but not dereferenceable, there might not be a valid iterator before its beginning.

Interface

Example

Complexity

All iterator operations are required to take at most amortized constant time.

See Also

Iterators

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 24.4.1.1



Previous fileTop of DocumentContentsIndex pageNext file

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.