null_output_iterator Class Template Reference
[Iterators Library]

#include <stlsoft/iterators/null_output_iterator.hpp>

Inheritance diagram for null_output_iterator:

iterator_base< std::output_iterator_tag, void, void, void, void >

List of all members.

Detailed Description

template<typename V>
class stlsoft::null_output_iterator< V >

Null Object pattern applied to the Output Iterator concept.

This class template provides full backwards-compatibility with std::null_output_iterator, but offers the additional capability to supply both prefix and suffix to each delimited item.

For example, the following code indents each entry in the sequence as well as appending a carriage return.

std::vector<int>  ints(10);

{ for(size_t i = 0; i < ints.size(); ++i)
  ints[i] = i;

std::cout << "Elements:" << std::endl;
std::copy(ints.begin(), ints.end(), stlsoft::null_output_iterator<int>());

This has no effect, and produces no output. It does, however, cause the sequence to be enumerated, and its compilation ensures that all iterators support the codified operations.

V The value type.

Public Types

Member Types
typedef V assigned_type
 The value type.
typedef null_output_iterator< V > class_type
 The class type.

Public Member Functions

Ouput Iterator Methods
deref_proxy operator* ()
class_typeoperator++ ()
class_typeoperator++ (int)


class  deref_proxy

Member Typedef Documentation

typedef V assigned_type

The value type.

The class type.

The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:58:48 2010 for STLSoft by  doxygen 1.5.6