Skip to content. Skip to navigation

ICTP Portal

Sections
You are here: Home Manuals on-line PGI Compiler pgC_lib Forward Iterators
Personal tools
Document Actions

Forward Iterators



Click on the banner to return to the class reference home page.

Forward Iterators


Iterator

Summary

A forward-moving iterator that can both read and write.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

None

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. Forward iterators are forward moving, 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 requirements 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 Forward Iterators

The following expressions must be valid 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
return value convertible to T&
a->m
equivalent to (*a).m
++r
returns X&
r++
return value convertible to const X&
*r++
returns T&

Forward 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

Iterators, Bidirectional Iterators


©Copyright 1996, Rogue Wave Software, Inc.

Weather
No information available
 

Powered by Plone This site conforms to the following standards: