Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

ostream_iterator

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