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

Input Iterators

Module:  Standard C++ Library   Library:  Iterators

Local Index

No Entries

Summary

A read-only, forward moving iterator

Description


NOTE -- 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. Input iterators are read-only, forward moving iterators that satisfy the requirements listed below.

Key to Iterator Requirements

The following key pertains to the iterator requirement descriptions listed below:

a and b

values of type X

n

value representing a distance between two iterators

u, Distance, tmp and m

identifiers

r

value of type X&

t

value of type T

Requirements for Input Iterators

The following expressions must be valid for input iterators:

X u(a)

copy constructor, u == a

X u = a

assignment, u == a

a == b, a != b

return value convertible to bool

*a

a == b implies *a == *b

++r

returns X&

r++

return value convertible to const X&

*r++

returns type T

a -> m

returns (*a).m

For input iterators, a == b does not imply that ++a == ++b.

Algorithms using input iterators should be single pass algorithms. That is, they should not pass through the same iterator twice.

The value of type T does not have to be an lvalue.

See Also

Iterators, Output Iterators

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 24.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.