Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

HP C++ User Documentation

 

bidirectional_iterators (3C++std) - Tru64 UNIX

Standard C++ Library
Copyright 1996, Rogue Wave Software, Inc.

NAME

  Bidirectional_Iterators  - An iterator that can both read and write and can
  traverse a container in both directions

DESCRIPTION

  For a complete discussion of iterators, see the Iterators section of this
  reference.

  Iterators are a generalization of pointers that allow a C++ program to
  uniformly interact with different data structures.  Bidirectional iterators
  can move both forwards and backwards through a container, and have the
  ability to both read and write data.  These iterators satisfy the
  requirements listed below.

  KEY TO ITERATOR REQUIREMENTS

  The following key pertains to the iterator descriptions listed below:

  a and b   values of type X

  n   value of distance type

  u, Distance, tmp and m   identifiers

  r   value of type X&

  t   value of type T

  REQUIREMENTS FOR BIDIRECTIONAL ITERATORS

  A bidirectional iterator must meet all the requirements listed below.  Note
  that most of these requirements are also the requirements for forward
  iterators.

  X u   u might have a singular value

  X()   X() might be singular

  X(a)   copy constructor, a == X(a).

  X u(a)   copy constructor, u == a

  X u = a   assignment, u == a

  a == b, a != b   return value convertible to bool

  a->m   equivalent to (*a).m

  *a   return value convertible to T&

  ++r   returns X&

  r++   return value convertible to const X&

  *r++   returns T&

  --r   returns X&

  r--   return value convertible to const X&

  *r--   returns T&

  Like forward iterators, bidirectional iterators have the condition that a
  == b implies *a== *b.

  There are no restrictions on the number of passes an algorithm may make
  through the structure.

SEE ALSO

  Containers, Iterators, Forward Iterators

STANDARDS CONFORMANCE

  ANSI X3J16/ISO WG21 Joint C++ Committee
About PDF files: The PDF files on this site can be read online or printed using Adobe® Acrobat® Reader. If you do not have this software on your system, you may download it from Adobe's website.
Privacy statement Using this site means you accept its terms C++ support
© 2008 Hewlett-Packard Development Company, L.P.