STD::OSTREAM_ITERATOR(3)
πΈ NAME πΈ
std::ostream_iterator< _Tp, _CharT, _Traits > β bestie, this is the little guy that gives you output iterator semantics for streams π (it's a (3) manual page, library functions manual, if you were wondering where you wandered into)
β¨ SYNOPSIS β¨
#include <iterator>
It inherits std::iterator< output_iterator_tag, void, void, void, void >.
π Public Types π
typedef output_iterator_tag iterator_categoryβ one of the tag types π·οΈtypedef void pointerβ this type represents a pointer-to-value_typetypedef void referenceβ this type represents a reference-to-value_typetypedef void value_typeβ the type "pointed to" by the iteratorusing difference_typeβ public typedef, that's it, that's the whole vibe
typedef _CharT char_typeβ public typedeftypedef _Traits traits_typeβ public typedeftypedef basic_ostream< _CharT, _Traits > ostream_typeβ public typedef
π¦ Public Member Functions π¦
ostream_iterator (const ostream_iterator &__obj) noexceptβ copy constructor πostream_iterator (ostream_type &__s) noexceptβ construct from an ostreamostream_iterator (ostream_type &__s, const _CharT *__c) noexceptostream_iterator & operator* () noexceptostream_iterator & operator++ () noexceptostream_iterator & operator++ (int) noexceptostream_iterator & operator= (const _Tp &__value)β writes value to the underlying ostream usingoperator<<. If it was constructed with a delimiter string, it writes the delimiter to the ostream too βοΈostream_iterator & operator= (const ostream_iterator &)=default
π Detailed Description π
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
class std::ostream_iterator< _Tp, _CharT, _Traits >"Provides output
iterator semantics for streams.
No cap, this class hands you an iterator that writes to an ostream π«Ά The type Tp is the only type written by this iterator, and there must be an operator<<(Tp) defined. Periodt.
π Template Parameters π
_Tpβ the type to write to the ostream._CharTβ the ostreamchar_type._Traitsβ the ostreamchar_traits.
π Member Typedef Documentation π
char_type
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
typedef _CharT std::ostream_iterator< _Tp, _CharT, _Traits >::char_type
Public typedef, iconic behavior π«
difference_type
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
using std::ostream_iterator< _Tp, _CharT, _Traits >::difference_type
Public typedef β¨
iterator_category (inherited)
typedef output_iterator_tag std::iterator< output_iterator_tag, void, void,
void, void >::iterator_category [inherited]
One of the tag types π·οΈ
ostream_type
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
typedef basic_ostream<_CharT, _Traits>
std::ostream_iterator< _Tp, _CharT, _Traits >::ostream_type
Public typedef πΈ
pointer (inherited)
typedef void std::iterator< output_iterator_tag, void, void, void, void
>::pointer [inherited]
This type represents a pointer-to-value_type.
reference (inherited)
typedef void std::iterator< output_iterator_tag, void, void, void, void
>::reference [inherited]
This type represents a reference-to-value_type.
traits_type
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
typedef _Traits std::ostream_iterator< _Tp, _CharT, _Traits >::traits_type
Public typedef π
value_type (inherited)
typedef void std::iterator< output_iterator_tag, void, void, void, void
>::value_type [inherited]
The type "pointed to" by the iterator π
π§ Constructor & Destructor Documentation π§
ostream_iterator (ostream_type & __s) β from an ostream
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
std::ostream_iterator< _Tp, _CharT, _Traits >::ostream_iterator (ostream_type
& __s) [inline], [noexcept]
Construct from an ostream π
References std::__addressof().
Referenced by ostream_iterator().
ostream_iterator (ostream_type & __s, const _CharT * __c) β from an ostream + delimiter
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
std::ostream_iterator< _Tp, _CharT, _Traits >::ostream_iterator (ostream_type
& __s, const _CharT * __c) [inline], [noexcept]
Construct from an ostream.
The delimiter string c is written to the stream after every Tp written to the stream. The delimiter is not copied, and thus must not be destroyed while this iterator is in use β οΈ
Parameters
__sβ underlying ostream to write to.__cβCharTdelimiter string to insert.
References std::__addressof().
ostream_iterator (const ostream_iterator< _Tp, _CharT, _Traits > & __obj) β copy constructor
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
std::ostream_iterator< _Tp, _CharT, _Traits >::ostream_iterator (const
ostream_iterator< _Tp, _CharT, _Traits > & __obj) [inline], [noexcept]
Copy constructor π«Ά
References ostream_iterator().
π Member Function Documentation π
operator= (const _Tp & __value)
template<typename _Tp, typename _CharT = char, typename _Traits =
char_traits<_CharT>>
ostream_iterator & std::ostream_iterator< _Tp, _CharT, _Traits >::operator=
(const _Tp & __value) [inline]
Writes value to the underlying ostream using operator<<. If it was constructed with a delimiter string, writes the delimiter to the ostream too. Slay π
β Author β
Generated automatically by Doxygen for libstdc++ from the source code.
okay bestie that's the whole page π that was libstdc++, std::ostre..., _Traits >(3), and yes the title got cut off by the page header, we don't talk about it π go write some iterators, you've got this πβ¨
π¦ 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