33#ifndef _GLIBCXX_OSTREAM
34#define _GLIBCXX_OSTREAM 1
36#pragma GCC system_header
43namespace std _GLIBCXX_VISIBILITY(default)
45_GLIBCXX_BEGIN_NAMESPACE_VERSION
59 template<
typename _CharT,
typename _Traits>
64 typedef _CharT char_type;
65 typedef typename _Traits::int_type int_type;
66 typedef typename _Traits::pos_type pos_type;
67 typedef typename _Traits::off_type off_type;
68 typedef _Traits traits_type;
110 operator<<(__ostream_type& (*__pf)(__ostream_type&))
169 {
return _M_insert(__n); }
173 {
return _M_insert(__n); }
177 {
return _M_insert(__n); }
187 return _M_insert(
static_cast<unsigned long>(__n));
198 return _M_insert(
static_cast<unsigned long>(__n));
201#ifdef _GLIBCXX_USE_LONG_LONG
204 {
return _M_insert(__n); }
208 {
return _M_insert(__n); }
223 {
return _M_insert(__f); }
230 return _M_insert(
static_cast<double>(__f));
235 {
return _M_insert(__f); }
238#if defined(__STDCPP_FLOAT16_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
239 __attribute__((__always_inline__))
243 return _M_insert(
static_cast<double>(__f));
247#if defined(__STDCPP_FLOAT32_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
248 __attribute__((__always_inline__))
252 return _M_insert(
static_cast<double>(__f));
256#if defined(__STDCPP_FLOAT64_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
257 __attribute__((__always_inline__))
261 return _M_insert(
static_cast<double>(__f));
265#if defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128)
266 __attribute__((__always_inline__))
270 return _M_insert(
static_cast<long double>(__f));
274#if defined(__STDCPP_BFLOAT16_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
275 __attribute__((__always_inline__))
279 return _M_insert(
static_cast<double>(__f));
293 {
return _M_insert(__p); }
295#if __cplusplus >= 201703L
298 {
return *
this <<
"nullptr"; }
301#if __cplusplus > 202002L
302 __attribute__((__always_inline__))
305 {
return _M_insert(
const_cast<const void*
>(__p)); }
434#if __cplusplus >= 201103L
442 { __ios_type::move(__rhs); }
457 { __ios_type::swap(__rhs); }
460 template<
typename _ValueT>
462 _M_insert(_ValueT __v);
465#if !_GLIBCXX_INLINE_VERSION
467 _M_write(
const char_type* __s,
streamsize __n)
468 { std::__ostream_insert(*
this, __s, __n); }
479 template <
typename _CharT,
typename _Traits>
501#pragma GCC diagnostic push
502#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
516 if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
520#pragma GCC diagnostic pop
529#if __cplusplus >= 201103L
532 operator bool()
const
552 template<
typename _CharT,
typename _Traits>
556 if (__out.
width() != 0)
557 return __ostream_insert(__out, &__c, 1);
562 template<
typename _CharT,
typename _Traits>
563 inline basic_ostream<_CharT, _Traits>&
564 operator<<(basic_ostream<_CharT, _Traits>& __out,
char __c)
565 {
return (__out << __out.widen(__c)); }
568 template<
typename _Traits>
572 if (__out.width() != 0)
573 return __ostream_insert(__out, &__c, 1);
579 template<
typename _Traits>
582 {
return (__out <<
static_cast<char>(__c)); }
584 template<
typename _Traits>
587 {
return (__out <<
static_cast<char>(__c)); }
589#if __cplusplus > 201703L
593 template<
typename _Traits>
597#ifdef _GLIBCXX_USE_CHAR8_T
598 template<
typename _Traits>
603 template<
typename _Traits>
607 template<
typename _Traits>
611#ifdef _GLIBCXX_USE_WCHAR_T
612#ifdef _GLIBCXX_USE_CHAR8_T
613 template<
typename _Traits>
618 template<
typename _Traits>
622 template<
typename _Traits>
643 template<
typename _CharT,
typename _Traits>
650 __ostream_insert(__out, __s,
651 static_cast<streamsize>(_Traits::length(__s)));
655 template<
typename _CharT,
typename _Traits>
660 template<
typename _Traits>
667 __ostream_insert(__out, __s,
668 static_cast<streamsize>(_Traits::length(__s)));
673 template<
typename _Traits>
676 {
return (__out <<
reinterpret_cast<const char*
>(__s)); }
678 template<
typename _Traits>
681 {
return (__out <<
reinterpret_cast<const char*
>(__s)); }
683#if __cplusplus > 201703L
687 template<
typename _Traits>
691#ifdef _GLIBCXX_USE_CHAR8_T
692 template<
typename _Traits>
697 template<
typename _Traits>
701 template<
typename _Traits>
705#ifdef _GLIBCXX_USE_WCHAR_T
706#ifdef _GLIBCXX_USE_CHAR8_T
707 template<
typename _Traits>
712 template<
typename _Traits>
716 template<
typename _Traits>
733 template<
typename _CharT,
typename _Traits>
745 template<
typename _CharT,
typename _Traits>
746 inline basic_ostream<_CharT, _Traits>&
748 {
return __os.
put(_CharT()); }
755 template<
typename _CharT,
typename _Traits>
756 inline basic_ostream<_CharT, _Traits>&
758 {
return __os.
flush(); }
760#if __cplusplus >= 201103L
765#if __cpp_lib_concepts
767 template<
typename _Tp>
768 concept __derived_from_ios_base = is_class_v<_Tp>
769 && (!is_same_v<_Tp, ios_base>)
770 &&
requires (_Tp* __t, ios_base* __b) { __b = __t; };
772 template<
typename _Os,
typename _Tp>
773 requires __derived_from_ios_base<_Os>
774 &&
requires (_Os& __os,
const _Tp& __t) { __os << __t; }
775 using __rvalue_stream_insertion_t = _Os&&;
777 template<
typename _Tp>
778 using _Require_derived_from_ios_base
779 = _Require<is_class<_Tp>, __not_<is_same<_Tp, ios_base>>,
780 is_convertible<typename add_pointer<_Tp>::type,
ios_base*>>;
782 template<
typename _Os,
typename _Tp,
783 typename = _Require_derived_from_ios_base<_Os>,
786 using __rvalue_stream_insertion_t = _Os&&;
799 template<
typename _Ostream,
typename _Tp>
800 inline __rvalue_stream_insertion_t<_Ostream, _Tp>
807#if __cplusplus > 201703L && _GLIBCXX_USE_CXX11_ABI
808 template<
typename _CharT,
typename _Traits>
816 if (
auto __p =
dynamic_cast<__syncbuf_base*
>(__buf))
817 return &__p->_M_emit_on_sync;
828 bool _M_emit_on_sync =
false;
829 bool _M_needs_sync =
false;
832 template<
typename _CharT,
typename _Traits>
836 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
841 template<
typename _CharT,
typename _Traits>
845 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
850 template<
typename _CharT,
typename _Traits>
856 ~_Restore() { *_M_flag = _M_prev; }
858 bool _M_prev =
false;
859 bool* _M_flag = &_M_prev;
862 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
864 __restore._M_prev = *__flag;
865 __restore._M_flag = __flag;
877_GLIBCXX_END_NAMESPACE_VERSION
auto declval() noexcept -> decltype(__declval< _Tp >(0))
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
basic_ostream< _CharT, _Traits > & ends(basic_ostream< _CharT, _Traits > &__os)
Write a null character into the output sequence.
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
Write a newline and flush the stream.
basic_ostream< _CharT, _Traits > & flush(basic_ostream< _CharT, _Traits > &__os)
Flushes the output stream.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
void setstate(iostate __state)
Sets additional flags in the error state.
void init(basic_streambuf< _CharT, _Traits > *__sb)
All setup is performed here.
char_type widen(char __c) const
Widens characters.
basic_ios(basic_streambuf< _CharT, _Traits > *__sb)
Constructor performs initialization.
The actual work of input and output (interface).
Template class basic_ostream.
__ostream_type & write(const char_type *__s, streamsize __n)
Character string insertion.
pos_type tellp()
Getting the current write position.
__ostream_type & seekp(off_type, ios_base::seekdir)
Changing the current write position.
__ostream_type & put(char_type __c)
Simple insertion.
basic_ostream(__streambuf_type *__sb)
Base constructor.
__ostream_type & flush()
Synchronizing the stream buffer.
__ostream_type & seekp(pos_type)
Changing the current write position.
virtual ~basic_ostream()
Base destructor.
__ostream_type & operator<<(__ostream_type &(*__pf)(__ostream_type &))
Interface for manipulators.
Template class basic_iostream.
~sentry()
Possibly flushes the stream.
sentry(basic_ostream< _CharT, _Traits > &__os)
The constructor performs preparatory work.
The base of the I/O class hierarchy.
static const fmtflags unitbuf
Flushes output after each output operation.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
streamsize width() const
Flags access.
_Ios_Seekdir seekdir
This is an enumerated type.
Primary class template ctype facet.
Primary class template num_put.