.\" ident @(#)Bidirectional_Iterators.3 .\" Standard Template Library .\" $$RW_INSERT_HEADER "slyrs.man" .TH Bidirectional_Iterators 3C++ "02 Apr 1998" "Rogue Wave Software" "-" .ce2 Standard C++ Library Copyright 1998, Rogue Wave Software, Inc. .SH NAME \f2Bidirectional_Iterators\fP \ - An iterator that can both read and write and can traverse a container in both directions .SH DESCRIPTION .B NOTE: .RS 3 For a complete discussion of iterators, see the Iterators section of this reference. .RE 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. .SH KEY TO ITERATOR REQUIREMENTS The following key pertains to the iterator descriptions listed below: .HP 10 \f2a and b \fPvalues of type \f2X\fP .HP 0 .HP 4 \f2n \fPvalue representing a \f2distance\fP between two iterators .HP 0 .HP 25 \f2u, Distance, tmp and m \fPidentifiers .HP 0 .HP 4 \f2r \fPvalue of type \f2X&\fP .HP 0 .HP 4 \f2t \fPvalue of type \f2T\fP .HP 0 .SH 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. .HP 6 \f2X u u\fP might have a singular value .HP 0 .HP 6 \f2X() X()\fP might be singular .HP 0 .HP 7 \f2X(a) \fPcopy constructor,\f2 a == X(a)\fP .HP 0 .HP 9 \f2X u(a) \fPcopy constructor, \f2u == a\fP .HP 0 .HP 10 \f2X u = a \fPassignment, \f2u == a\fP .HP 0 .HP 8 \f2r = a \fPassignment, \f2r == a\fP .HP 0 .HP 17 \f2a == b, a != b \fPreturn value convertible to \f2bool\fP .HP 0 .HP 7 \f2a->m \fPequivalent to \f2(*a).m\fP .HP 0 .HP 5 \f2*a \fPreturn value convertible to \f2T&\fP .HP 0 .HP 6 \f2++r \fPreturns \f2X&\fP .HP 0 .HP 6 \f2r++ \fPreturn value convertible to const \f2X&\fP .HP 0 .HP 7 \f2*r++ \fPreturns \f2T&\fP .HP 0 .HP 6 \f2--r \fPreturns \f2X&\fP .HP 0 .HP 6 \f2r-- \fPreturn value convertible to const \f2X&\fP .HP 0 .HP 7 \f2*r-- \fPreturns \f2T&\fP .HP 0 Like forward iterators, bidirectional iterators have the condition that \f2a == b\fP implies \f2*a== *b\fP. There are no restrictions on the number of passes an algorithm may make through the structure. .SH SEE ALSO Containers, Iterators, Forward_Iterators