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)); }
400#if __cplusplus >= 201103L
408 { __ios_type::move(__rhs); }
423 { __ios_type::swap(__rhs); }
426 template<
typename _ValueT>
428 _M_insert(_ValueT __v);
438 template <
typename _CharT,
typename _Traits>
460#pragma GCC diagnostic push
461#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
475 if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
479#pragma GCC diagnostic pop
488#if __cplusplus >= 201103L
491 operator bool()
const
511 template<
typename _CharT,
typename _Traits>
514 {
return __ostream_insert(__out, &__c, 1); }
516 template<
typename _CharT,
typename _Traits>
517 inline basic_ostream<_CharT, _Traits>&
518 operator<<(basic_ostream<_CharT, _Traits>& __out,
char __c)
519 {
return (__out << __out.widen(__c)); }
522 template<
typename _Traits>
525 {
return __ostream_insert(__out, &__c, 1); }
528 template<
typename _Traits>
531 {
return (__out <<
static_cast<char>(__c)); }
533 template<
typename _Traits>
536 {
return (__out <<
static_cast<char>(__c)); }
538#if __cplusplus > 201703L
542 template<
typename _Traits>
546#ifdef _GLIBCXX_USE_CHAR8_T
547 template<
typename _Traits>
552 template<
typename _Traits>
556 template<
typename _Traits>
560#ifdef _GLIBCXX_USE_WCHAR_T
561#ifdef _GLIBCXX_USE_CHAR8_T
562 template<
typename _Traits>
567 template<
typename _Traits>
571 template<
typename _Traits>
592 template<
typename _CharT,
typename _Traits>
599 __ostream_insert(__out, __s,
600 static_cast<streamsize>(_Traits::length(__s)));
604 template<
typename _CharT,
typename _Traits>
609 template<
typename _Traits>
616 __ostream_insert(__out, __s,
617 static_cast<streamsize>(_Traits::length(__s)));
622 template<
typename _Traits>
625 {
return (__out <<
reinterpret_cast<const char*
>(__s)); }
627 template<
typename _Traits>
630 {
return (__out <<
reinterpret_cast<const char*
>(__s)); }
632#if __cplusplus > 201703L
636 template<
typename _Traits>
640#ifdef _GLIBCXX_USE_CHAR8_T
641 template<
typename _Traits>
646 template<
typename _Traits>
650 template<
typename _Traits>
654#ifdef _GLIBCXX_USE_WCHAR_T
655#ifdef _GLIBCXX_USE_CHAR8_T
656 template<
typename _Traits>
661 template<
typename _Traits>
665 template<
typename _Traits>
682 template<
typename _CharT,
typename _Traits>
694 template<
typename _CharT,
typename _Traits>
695 inline basic_ostream<_CharT, _Traits>&
697 {
return __os.
put(_CharT()); }
704 template<
typename _CharT,
typename _Traits>
705 inline basic_ostream<_CharT, _Traits>&
707 {
return __os.
flush(); }
709#if __cplusplus >= 201103L
714#if __cpp_lib_concepts
716 template<
typename _Tp>
717 concept __derived_from_ios_base = is_class_v<_Tp>
718 && (!is_same_v<_Tp, ios_base>)
719 &&
requires (_Tp* __t, ios_base* __b) { __b = __t; };
721 template<
typename _Os,
typename _Tp>
722 requires __derived_from_ios_base<_Os>
723 &&
requires (_Os& __os,
const _Tp& __t) { __os << __t; }
724 using __rvalue_stream_insertion_t = _Os&&;
726 template<
typename _Tp>
727 using _Require_derived_from_ios_base
728 = _Require<is_class<_Tp>, __not_<is_same<_Tp, ios_base>>,
731 template<
typename _Os,
typename _Tp,
732 typename = _Require_derived_from_ios_base<_Os>,
735 using __rvalue_stream_insertion_t = _Os&&;
748 template<
typename _Ostream,
typename _Tp>
749 inline __rvalue_stream_insertion_t<_Ostream, _Tp>
756#if __cplusplus > 201703L && _GLIBCXX_USE_CXX11_ABI
757 template<
typename _CharT,
typename _Traits>
765 if (
auto __p =
dynamic_cast<__syncbuf_base*
>(__buf))
766 return &__p->_M_emit_on_sync;
777 bool _M_emit_on_sync =
false;
778 bool _M_needs_sync =
false;
781 template<
typename _CharT,
typename _Traits>
785 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
790 template<
typename _CharT,
typename _Traits>
794 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
799 template<
typename _CharT,
typename _Traits>
805 ~_Restore() { *_M_flag = _M_prev; }
807 bool _M_prev =
false;
808 bool* _M_flag = &_M_prev;
811 if (
bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
813 __restore._M_prev = *__flag;
814 __restore._M_flag = __flag;
826_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_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
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.
void _M_write(const char_type *__s, streamsize __n)
Core write functionality, without sentry.
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...
_Ios_Seekdir seekdir
This is an enumerated type.
Primary class template ctype facet.
Primary class template num_put.