They are constructed from a basic_streambuf object open for writing, to which they become associated.
It is defined with an operation similar to:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Template parameters
- charT
- Character type. This is the first template parameter in the basic_streambuf object.
- traits
- Character traits. This is the second template parameter in basic_streambuf object.
Member functions
- constructor
- ostreambuf_iterator objects are constructed from either a basic_streambuf object or a basic_ostream object.
- operator=
- Writes an element into the stream buffer.
- operator*
- Returns the current value in the stream buffer.
- operator*
- Does nothing. Returns a reference to the object.
- operator++
- Does nothing. Returns a reference to the object.
- failed
- Returns whether a previous writing operation failed (i.e. streambuf::sputc returned traits::eof() in a previous call to operator=).
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Possible output:
Some text here... |
See also
| istreambuf_iterator | Input stream buffer iterator (class template) |
| OutputIterator | Output iterator category |
| ostream | Output Stream (class) |
