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

ostream_iterator

Module:  Standard C++ Library   Library:  Iterators


ostream_iterator iterator

Local Index

Members

Summary

Stream iterators allow for use of iterators with ostreams and istreams. They allow generic algorithms to be used directly on streams.

Synopsis

#include <ostream>

namespace std {
  template <class T, class charT, 
            class traits = char_traits<charT> >
  class ostream_iterator;
}

Description

Stream iterators use the standard iterator interface for input and output streams.

The class template ostream_iterator writes elements to an output stream. If you use the constructor that has a second argument, then that string is written after every element (the string must be null-terminated). Since an ostream iterator is an output iterator, it is not possible to dereference values through the iterator. You can only assign to it.

Interface

Member Types

char_type; 
traits_type; 
ostream_type; 

Constructors

ostream_iterator (ostream_type& s);
ostream_iterator (ostream_type& s, 
                  const char_type* delimiter);
ostream_iterator (const ostream_iterator& x);

Operators

const T& 
operator= (const T& value);
const T& ostream_iterator& 
operator* ();
ostream_iterator&  
operator++();
ostream_iterator
operator++ (int);

Example

See Also

istream_iterator, Iterators

Standards Conformance

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