STD::OSTREAMBUF_ITERATOR(3)

πŸ’– std::ostreambuf_iterator< _CharT, _Traits > πŸ’–

okay so bestie, welcome to the libstdc++ manual, section 3, Library Functions Manual β€” yes that's the manual name, and yeah the title line is the whole std::ostreambuf_iterator< _CharT, _Traits > thing, we're folding it in right here, you're welcome 🫢


✨ NAME ✨

std::ostreambuf_iterator< _CharT, _Traits > β€” it's giving output iterator semantics for streambufs. literally that's the whole job. no cap. πŸ’…


✨ SYNOPSIS ✨

#include <iterator>

Inherits std::iterator< output_iterator_tag, void, void, void, void >. so it's an iterator, it said what it said πŸ‘‘

🌸 Public Types 🌸

  • typedef output_iterator_tag iterator_category β€” one of the tag types, it's literally the category tag bestie.
  • typedef void pointer β€” this type represents a pointer-to-value_type.
  • typedef void reference β€” this type represents a reference-to-value_type.
  • typedef void value_type β€” the type "pointed to" by the iterator.
    • using difference_type β€” public typedefs.
    • typedef _CharT char_type β€” public typedefs.
    • typedef _Traits traits_type β€” public typedefs.
    • typedef basic_streambuf< _CharT, _Traits > streambuf_type β€” public typedefs.
    • typedef basic_ostream< _CharT, _Traits > ostream_type β€” public typedefs.

πŸ¦‹ Public Member Functions πŸ¦‹

  • ostreambuf_iterator (ostream_type &__s) noexcept β€” construct output iterator from an ostream ✨
  • ostreambuf_iterator (streambuf_type *__s) noexcept β€” construct output iterator from a streambuf ✨
  • ostreambuf_iterator & _M_put (const _CharT *__ws, streamsize __len) β€” the internal putter, it's doing the work behind the scenes πŸ’…
  • bool failed () const noexcept β€” return true if the previous operator=() failed 😭
  • ostreambuf_iterator & operator* () β€” return *this. that's it. that's the function.
  • ostreambuf_iterator & operator++ () β€” return *this. again. iconic behaviour honestly.
  • ostreambuf_iterator & operator++ (int) β€” return *this. third time's the charm πŸŽ€
  • ostreambuf_iterator & operator= (_CharT __c) β€” write character to streambuf. calls streambuf.sputc(). this is the main character right here πŸ‘‘

πŸ’œ Friends πŸ’œ

template<typename _CharT2> __gnu_cxx::__enable_if< __is_char< _CharT2 >::__value, ostreambuf_iterator< _CharT2 > >::__type copy
(istreambuf_iterator< _CharT2 >, istreambuf_iterator< _CharT2 >,
 ostreambuf_iterator< _CharT2 >)

🌈 Detailed Description 🌈

template<typename _CharT, typename _Traits>
class std::ostreambuf_iterator< _CharT, _Traits >

"Provides output iterator semantics for streambufs." β€” that's the official vibe check and it passed βœ…


πŸŽ€ Member Typedef Documentation πŸŽ€

  • ```cpp template<typename _CharT, typename _Traits> typedef _CharT std::ostreambuf_iterator< _CharT, _Traits >::char_type
public typedefs.

- ```cpp
template<typename _CharT, typename _Traits> using std::ostreambuf_iterator<
_CharT, _Traits >::difference_type

public typedefs.

  • ```cpp typedef output_iterator_tag std::iterator< output_iterator_tag, void, void, void, void >::iterator_category [inherited]
one of the tag types.

- ```cpp
template<typename _CharT, typename _Traits> typedef basic_ostream<_CharT,
_Traits> std::ostreambuf_iterator< _CharT, _Traits >::ostream_type

public typedefs.

  • ```cpp typedef void std::iterator< output_iterator_tag, void, void, void, void
::pointer [inherited]
this type represents a pointer-to-`value_type`.

- ```cpp
typedef void std::iterator< output_iterator_tag, void, void, void, void
>::reference [inherited]

this type represents a reference-to-value_type.

  • ```cpp template<typename _CharT, typename _Traits> typedef basic_streambuf<_CharT, _Traits> std::ostreambuf_iterator< _CharT, _Traits >::streambuf_type
public typedefs.

- ```cpp
template<typename _CharT, typename _Traits> typedef _Traits
std::ostreambuf_iterator< _CharT, _Traits >::traits_type

public typedefs.

  • ```cpp typedef void std::iterator< output_iterator_tag, void, void, void, void
::value_type [inherited]
the type "pointed to" by the iterator.

---

# ⭐ Constructor & Destructor Documentation ⭐

- ```cpp
template<typename _CharT, typename _Traits> std::ostreambuf_iterator<
_CharT, _Traits >::ostreambuf_iterator (ostream_type & __s) [inline],
[noexcept]

construct output iterator from ostream πŸ’–

  • ```cpp template<typename _CharT, typename _Traits> std::ostreambuf_iterator< _CharT, _Traits >::ostreambuf_iterator (streambuf_type * __s) [inline], [noexcept]
construct output iterator from streambuf πŸ’–

---

# πŸ”₯ Member Function Documentation πŸ”₯

- ```cpp
template<typename _CharT, typename _Traits> bool std::ostreambuf_iterator<
_CharT, _Traits >::failed () const [inline],  [nodiscard],  [noexcept]

return true if previous operator=() failed.

Referenced by std::basic_ostream< _CharT, _Traits >::operator<<().
  • ```cpp template<typename _CharT, typename _Traits> ostreambuf_iterator & std::ostreambuf_iterator< _CharT, _Traits >::operator* () [inline], [nodiscard]
return `*this`.

- ```cpp
template<typename _CharT, typename _Traits> ostreambuf_iterator &
std::ostreambuf_iterator< _CharT, _Traits >::operator++ () [inline]

return *this.

  • ```cpp template<typename _CharT, typename _Traits> ostreambuf_iterator & std::ostreambuf_iterator< _CharT, _Traits >::operator++ (int ) [inline]
return `*this`.

- ```cpp
template<typename _CharT, typename _Traits> ostreambuf_iterator &
std::ostreambuf_iterator< _CharT, _Traits >::operator= (_CharT __c)
[inline]

write character to streambuf. calls streambuf.sputc().


πŸ‘‘ Author πŸ‘‘

generated automatically by Doxygen for libstdc++ from the source code. not a human, just vibes and a parser 🫢


okay bestie that's the whole page, every single flag, typedef, function and inherited thing accounted for, no skips, no cap. this was libstdc++ manual page std::ostre..., _Traits >(3), and yeah the footer was doing the same std::ostre..., _Traits >(3) thing with libstdc++ on the left, so consider yourself formally dismissed πŸ’…βœ¨ slay, go write to a streambuf or something πŸ¦‹

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms