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

Output Iterators

Module:  Standard C++ Library   Library:  Iterators

Local Index

No Entries

Summary

A write 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. Output iterators are write-only, forward moving iterators that satisfy the requirements listed below. Note that unlike other iterators used with the standard library, output iterators cannot be constant.

Key to Iterator Requirements

The following key pertains to the iterator requirements listed below:

a

values of type X

u

identifiers

r

value of type X&

t

value of type T

Requirements for Output Iterators

The following expressions must be valid for output iterators:

X(a)

copy constructor, a == X(a)

X u(a)

copy constructor, u == a

X u = a

assignment, u == a

*a = t

result is not used

++r

returns X&

r++

return value convertible to const X&

*r++ = t

result is not used

The only valid use for the operator * is on the left-hand side of the assignment statement.

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

See Also

Iterators, Input Iterators

Standards Conformance

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



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.