CARVIEW |
Select Language
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 28 Jul 2025 02:34:33 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Location: /reference/iterator/ostreambuf_iterator/
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 28 Jul 2025 02:34:33 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
ETag: W/"81aa-wxpv7TpegvhexDzbziVyW1lUjlg"
Content-Encoding: gzip
Ostreambuf iterators are output iterators that write sequentially to an stream buffer.
They are constructed from a basic_streambuf object open for writing, to which they become associated.
It is defined with a behavior similar to:
Output:
Reference
C library:
- <cassert> (assert.h)
- <cctype> (ctype.h)
- <cerrno> (errno.h)
-
<cfenv> (fenv.h)C++11
- <cfloat> (float.h)
-
<cinttypes> (inttypes.h)C++11
- <ciso646> (iso646.h)
- <climits> (limits.h)
- <clocale> (locale.h)
- <cmath> (math.h)
- <csetjmp> (setjmp.h)
- <csignal> (signal.h)
- <cstdarg> (stdarg.h)
-
<cstdbool> (stdbool.h)C++11
- <cstddef> (stddef.h)
-
<cstdint> (stdint.h)C++11
- <cstdio> (stdio.h)
- <cstdlib> (stdlib.h)
- <cstring> (string.h)
-
<ctgmath> (tgmath.h)C++11
- <ctime> (time.h)
-
<cuchar> (uchar.h)C++11
- <cwchar> (wchar.h)
- <cwctype> (wctype.h)
Containers:
-
<array>C++11
- <deque>
-
<forward_list>C++11
- <list>
- <map>
- <queue>
- <set>
- <stack>
-
<unordered_map>C++11
-
<unordered_set>C++11
- <vector>
-
Input/Output:
Multi-threading:
-
<atomic>C++11
-
<condition_variable>C++11
-
<future>C++11
-
<mutex>C++11
-
<thread>C++11
-
Other:
- <algorithm>
- <bitset>
-
<chrono>C++11
-
<codecvt>C++11
- <complex>
- <exception>
- <functional>
-
<initializer_list>C++11
- <iterator>
- <limits>
- <locale>
- <memory>
- <new>
- <numeric>
-
<random>C++11
-
<ratio>C++11
-
<regex>C++11
- <stdexcept>
- <string>
-
<system_error>C++11
-
<tuple>C++11
-
<type_traits>C++11
-
<typeindex>C++11
- <typeinfo>
- <utility>
- <valarray>
<iterator>
- iterator
- iterator_traits
functions
- advance
- back_inserter
-
beginC++11
- distance
-
endC++11
- front_inserter
- inserter
-
make_move_iteratorC++11
-
nextC++11
-
prevC++11
iterator categories
predefined iterators
- Reference
- <iterator>
- ostreambuf_iterator
class template
<iterator>
std::ostreambuf_iterator
template <class charT, class traits=char_traits<charT> > class ostreambuf_iterator;
Output stream buffer iterator
- iterator
- ostreambuf_iterator
Ostreambuf iterators are output iterators that write sequentially to an stream buffer.
They are constructed from a basic_streambuf object open for writing, to which they become associated.
It is defined with a behavior similar to:
|
|
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 types
member | definition in ostreambuf_iterator | description |
---|---|---|
streambuf_type | basic_streambuf<charT,traits> | Type of the associated basic_streambuf object |
ostream_type | basic_ostream<charT,traits> | |
iterator_category | onput_iterator_tag | Output iterator |
value_type | void | |
char_type | charT | Type of the characters handled by the associated stream buffer |
traits_type | traits | Character traits for associated stream buffer |
int_type | traits::int_type | Int type to represent character values or end-of-file |
difference_type | void | |
pointer | void | |
reference | void |
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
*this
. operator++(int)
- Does nothing. Returns
*this
. - failed
- Returns whether a previous writing operation failed (i.e. basic_streambuf::sputc returned
traits::eof()
in a previous call tooperator=
).
Example
|
|
Output:
Some text here... |
See also
- istreambuf_iterator
- Input stream buffer iterator (class template)
- output_iterator_tag
- Output iterator category (class)
- ostream
- Output Stream (class)
Home page | Privacy policy
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us