33#ifndef _GLIBCXX_OSTREAM
34#define _GLIBCXX_OSTREAM 1
36#pragma GCC system_header
41namespace std _GLIBCXX_VISIBILITY(default)
43_GLIBCXX_BEGIN_NAMESPACE_VERSION
57 template<
typename _CharT,
typename _Traits>
62 typedef _CharT char_type;
63 typedef typename _Traits::int_type int_type;
64 typedef typename _Traits::pos_type pos_type;
65 typedef typename _Traits::off_type off_type;
66 typedef _Traits traits_type;
108 operator<<(__ostream_type& (*__pf)(__ostream_type&))
167 {
return _M_insert(__n); }
171 {
return _M_insert(__n); }
175 {
return _M_insert(__n); }
185 return _M_insert(
static_cast<unsigned long>(__n));
196 return _M_insert(
static_cast<unsigned long>(__n));
199#ifdef _GLIBCXX_USE_LONG_LONG
202 {
return _M_insert(__n); }
206 {
return _M_insert(__n); }
221 {
return _M_insert(__f); }
228 return _M_insert(
static_cast<double>(__f));
233 {
return _M_insert(__f); }
246 {
return _M_insert(__p); }
248#if __cplusplus >= 201703L
251 {
return *
this <<
"nullptr"; }
254#if __cplusplus > 202002L
255 __attribute__((__always_inline__))
258 {
return _M_insert(
const_cast<const void*
>(__p)); }
387#if __cplusplus >= 201103L
395 { __ios_type::move(__rhs); }
410 { __ios_type::swap(__rhs); }
413 template<
typename _ValueT>
415 _M_insert(_ValueT __v);
418#if !_GLIBCXX_INLINE_VERSION
420 _M_write(
const char_type* __s,
streamsize __n)
421 { std::__ostream_insert(*
this, __s, __n); }
432 template <
typename _CharT,
typename _Traits>
454#pragma GCC diagnostic push
455#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
469 if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
473#pragma GCC diagnostic pop
482#if __cplusplus >= 201103L
485 operator bool()
const
505 template<
typename _CharT,
typename _Traits>
509 if (__out.
width() != 0)
510 return __ostream_insert(__out, &__c, 1);
515 template<
typename _CharT,
typename _Traits>
516 inline basic_ostream<_CharT, _Traits>&
517 operator<<(basic_ostream<_CharT, _Traits>& __out,
char __c)
518 {
return (__out << __out.widen(__c)); }
521 template<
typename _Traits>
525 if (__out.width() != 0)
526 return __ostream_insert(__out, &__c, 1);
532 template<
typename _Traits>
535 {
return (__out <<
static_cast<char>(__c)); }
537 template<
typename _Traits>
540 {
return (__out <<
static_cast<char>(__c)); }
542#if __cplusplus > 201703L
546 template<
typename _Traits>
550#ifdef _GLIBCXX_USE_CHAR8_T
551 template<
typename _Traits>
556 template<
typename _Traits>
560 template<
typename _Traits>
564#ifdef _GLIBCXX_USE_WCHAR_T
565#ifdef _GLIBCXX_USE_CHAR8_T
566 template<
typename _Traits>
571 template<
typename _Traits>
575 template<
typename _Traits>
596 template<
typename _CharT,
typename _Traits>
603 __ostream_insert(__out, __s,
604 static_cast<streamsize>(_Traits::length(__s)));
608 template<
typename _CharT,
typename _Traits>
613 template<
typename _Traits>
620 __ostream_insert(__out, __s,
621 static_cast<streamsize>(_Traits::length(__s)));
626 template<
typename _Traits>
629 {
return (__out <<
reinterpret_cast<const char*
>(__s)); }
631 template<
typename _Traits>
634 {
return (__out <<
reinterpret_cast<const char*
>(__s)); }
636#if __cplusplus > 201703L
640 template<
typename _Traits>
644#ifdef _GLIBCXX_USE_CHAR8_T
645 template<
typename _Traits>
650 template<
typename _Traits>
654 template<
typename _Traits>
658#ifdef _GLIBCXX_USE_WCHAR_T
659#ifdef _GLIBCXX_USE_CHAR8_T
660 template<
typename _Traits>
665 template<
typename _Traits>
669 template<
typename _Traits>
686 template<
typename _CharT,
typename _Traits>
698 template<
typename _CharT,
typename _Traits>
699 inline basic_ostream<_CharT, _Traits>&
701 {
return __os.
put(_CharT()); }
708 template<
typename _CharT,
typename _Traits>
709 inline basic_ostream<_CharT, _Traits>&
711 {
return __os.
flush(); }
713#if __cplusplus >= 201103L
718#if __cpp_lib_concepts
720 template<
typename _Tp>
721 concept __derived_from_ios_base = is_class_v<_Tp>
722 && (!is_same_v<_Tp, ios_base>)
723 &&
requires (_Tp* __t, ios_base* __b) { __b = __t; };
725 template<
typename _Os,
typename _Tp>
726 requires __derived_from_ios_base<_Os>
727 &&
requires (_Os& __os,
const _Tp& __t) { __os << __t; }
728 using __rvalue_stream_insertion_t = _Os&&;
730 template<
typename _Tp>
731 using _Require_derived_from_ios_base
732 = _Require<is_class<_Tp>, __not_<is_same<_Tp, ios_base>>,
735 template<
typename _Os,
typename _Tp,
736 typename = _Require_derived_from_ios_base<_Os>,
739 using __rvalue_stream_insertion_t = _Os&&;
752 template<
typename _Ostream,
typename _Tp>
753 inline __rvalue_stream_insertion_t<_Ostream, _Tp>
760#if __cplusplus > 201703L && _GLIBCXX_USE_CXX11_ABI
761 template<
typename _CharT,
typename _Traits>
769 if (
auto __p =
dynamic_cast<__syncbuf_base*
>(__buf))
770 return &__p->_M_emit_on_sync;
781 bool _M_emit_on_sync =
false;
782 bool _M_needs_sync =
false;
785 template<
typename _CharT,
typename _Traits>
789 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
794 template<
typename _CharT,
typename _Traits>
798 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
803 template<
typename _CharT,
typename _Traits>
809 ~_Restore() { *_M_flag = _M_prev; }
811 bool _M_prev =
false;
812 bool* _M_flag = &_M_prev;
815 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
817 __restore._M_prev = *__flag;
818 __restore._M_flag = __flag;
830_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.