STD::OSTREAMBUF_ITERATOR(3cxx)

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

Okay bestie, so this is the manual page for std::ostreambuf_iterator< _CharT, _Traits > from the C++ standard library (that's the 3cxx section, iykyk). It's literally the glow-up that gives streambufs output iterator energy. Let's get into it. ✨


🌸 SYNOPSIS 🌸

#include <iterator>

Inherits std::iterator< output_iterator_tag, void, void, void, void >. No cap, that's the whole vibe. πŸ¦‹

✨ Public Types ✨

  • typedef output_iterator_tag iterator_category β€” One of the tag types. It's giving "I know my category" energy. πŸ‘‘
  • typedef void pointer β€” This type represents a pointer-to-value_type. (It's void, so don't expect to dereference it, bestie. πŸ™ˆ)
  • typedef void reference β€” This type represents a reference-to-value_type. Also void, so no funny business. πŸ’€
  • typedef void value_type β€” The type 'pointed to' by the iterator. Again, voidβ€”it's minimal, it's mysterious, it's iconic. πŸŽ€
  • using difference_type = ptrdiff_t β€” Public typedefs. Standard issue, still slay. πŸ’…
  • typedef _CharT char_type β€” Public typedefs. Your character type, literally. 🌈
  • typedef _Traits traits_type β€” Public typedefs. The traits, the whole traits, and nothing but the traits. ⭐
  • typedef basic_streambuf< _CharT, _Traits > streambuf_type β€” Public typedefs. The streambuf it wraps. 🫢
  • typedef basic_ostream< _CharT, _Traits > ostream_type β€” Public typedefs. The ostream it can be built from. πŸ”₯

πŸ’… Public Member Functions πŸ’…

  • ostreambuf_iterator (ostream_type &__s) noexcept β€” Construct output iterator from ostream. Easy. 😌
  • ostreambuf_iterator (streambuf_type *__s) noexcept β€” Construct output iterator from streambuf. Also easy. ✨
  • ostreambuf_iterator & _M_put (const _CharT *__ws, streamsize __len) β€” Internal put magic. Not for your direct use, but it's there, doing the work. 🧚
  • bool failed () const noexcept β€” Return true if previous operator=() failed. It's the vibe check for your writes. πŸ’€
  • ostreambuf_iterator & operator* () β€” Return *this. Self-love, honestly. πŸ’–
  • ostreambuf_iterator & operator++ () β€” Return *this. Prefix increment, but make it fashion. πŸ‘‘
  • ostreambuf_iterator & operator++ (int) β€” Return *this. Postfix increment, same energy. πŸŽ€
  • ostreambuf_iterator & operator= (_CharT __c) β€” Write character to streambuf. Calls streambuf.sputc(). This is the main character move. πŸ”₯

πŸ¦‹ 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 >) β€” A friend function with template energy. It's a copy that knows its types. Respect. 🌈

πŸ’œ Detailed Description πŸ’œ

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

"Provides output iterator semantics for streambufs." That's the whole mood. It's the bridge between your iterator algorithms and your streambufs. Obsessed. 😭


🌟 Member Typedef Documentation 🌟

  • template<typename _CharT , typename _Traits > typedef _CharT std::ostreambuf_iterator< _CharT, _Traits >::char_type β€” Public typedefs. The character type. Simple, clean, necessary. 🌸
  • template<typename _CharT , typename _Traits > using std::ostreambuf_iterator< _CharT, _Traits >::difference_type = ptrdiff_t β€” Public typedefs. It's ptrdiff_t, bestie. Standard. πŸ’…
  • typedef output_iterator_tag std::iterator< output_iterator_tag , void , void , void , void >::iterator_category [inherited] β€” One of the tag types. Inherited, but still iconic. ⭐
  • template<typename _CharT , typename _Traits > typedef basic_ostream<_CharT, _Traits> std::ostreambuf_iterator< _CharT, _Traits >::ostream_type β€” Public typedefs. The ostream type. You know it. 🫢
  • typedef void std::iterator< output_iterator_tag , void , void , void , void >::pointer [inherited] β€” This type represents a pointer-to-value_type. It's void, so no dereferencing, okay? πŸ™ˆ
  • typedef void std::iterator< output_iterator_tag , void , void , void , void >::reference [inherited] β€” This type represents a reference-to-value_type. Also void. Keep it moving. πŸ’€
  • template<typename _CharT , typename _Traits > typedef basic_streambuf<_CharT, _Traits> std::ostreambuf_iterator< _CharT, _Traits >::streambuf_type β€” Public typedefs. The streambuf type. The whole point. πŸ”₯
  • template<typename _CharT , typename _Traits > typedef _Traits std::ostreambuf_iterator< _CharT, _Traits >::traits_type β€” Public typedefs. The traits. Always the traits. πŸŽ€
  • typedef void std::iterator< output_iterator_tag , void , void , void , void >::value_type [inherited] β€” The type 'pointed to' by the iterator. It's void. That's the tea. β˜•

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

  • template<typename _CharT , typename _Traits > std::ostreambuf_iterator< _CharT, _Traits >::ostreambuf_iterator (ostream_type & __s) [inline], [noexcept] β€” Construct output iterator from ostream. Inline, noexcept, flawless. ✨
  • template<typename _CharT , typename _Traits > std::ostreambuf_iterator< _CharT, _Traits >::ostreambuf_iterator (streambuf_type * __s) [inline], [noexcept] β€” Construct output iterator from streambuf. Also inline and noexcept. We love consistency. πŸ’–

🌈 Member Function Documentation 🌈

  • template<typename _CharT , typename _Traits > bool std::ostreambuf_iterator< _CharT, _Traits >::failed () const [inline], [noexcept] β€” Return true if previous operator=() failed. It's the "did that write flop?" check. 😭
  • template<typename _CharT , typename _Traits > ostreambuf_iterator & std::ostreambuf_iterator< _CharT, _Traits >::operator* () [inline] β€” Return *this. Self-return, self-love. πŸ’…
  • template<typename _CharT , typename _Traits > ostreambuf_iterator & std::ostreambuf_iterator< _CharT, _Traits >::operator++ () [inline] β€” Return *this. Prefix increment, but it's not about the positionβ€”it's about the vibe. πŸ‘‘
  • template<typename _CharT , typename _Traits > ostreambuf_iterator & std::ostreambuf_iterator< _CharT, _Traits >::operator++ (int) [inline] β€” Return *this. Postfix increment, same energy, same return. πŸ¦‹
  • template<typename _CharT , typename _Traits > ostreambuf_iterator & std::ostreambuf_iterator< _CharT, _Traits >::operator= (_CharT __c) [inline] β€” Write character to streambuf. Calls streambuf.sputc(). This is the moment. The write. The slay. πŸ”₯

πŸ’€ Author πŸ’€

Generated automatically by Doxygen for libstdc++ from the source code. So you know it's official. No cap. πŸ™ˆ


Heads up bestie: this iterator is all about writing to streambufs, and failed() is your bestie for checking if a write went wrong. Don't sleep on it. πŸ’–

Stay slay, stay curious, and may your streambufs always accept your characters. πŸ’…βœ¨ This page is from libstdc++ (manual section 3cxx), generated by Doxygen from the source code. You're gonna crush it with these iterators! πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from