An ostream_iterator
is an iterator adapter that writes data to an output stream. Dereferencing and writing to an ostream_iterator
uses the stream insertion operator >>
to write data to the specified output stream.
ostream_iterator
is a template type whose type argument is the type of element to write to the stream. For example, an ostream_iterator<int>
writes int
s to the stream.
Normally, ostream_iterator
s do not put any whitespace between the elements they write. You can change this behavior by setting a delimiter inside the ostream_iterator
constructor.
ostream_iterator<T>
Member Functionsostream_iterator
that writes to the specified stream.Constructs a new ostream_iterator
that writes to the specified stream. No whitespace is inserted between elements.
ostream_iterator
that writes elements, followed by a delimiter, to the stream.Constructs a new ostream_iterator
that writes to the specified stream. The string delimiter
is outputted to the stream after each element.