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'svoid, so don't expect to dereference it, bestie. π)typedef void referenceβ This type represents a reference-to-value_type. Alsovoid, 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β Returntrueif previousoperator=()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. Callsstreambuf.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 acopythat 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'sptrdiff_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'svoid, 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. Alsovoid. 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'svoid. 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]β Returntrueif previousoperator=()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. Callsstreambuf.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
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms