34#ifndef _GLIBCXX_OSTREAM_H
35#define _GLIBCXX_OSTREAM_H 1
38#pragma GCC system_header
46# define __glibcxx_want_print
65 template<
typename _CharT,
typename _Traits>
193 return _M_insert(
static_cast<unsigned long>(__n));
204 return _M_insert(
static_cast<unsigned long>(__n));
207#ifdef _GLIBCXX_USE_LONG_LONG
208#pragma GCC diagnostic push
209#pragma GCC diagnostic ignored "-Wlong-long"
217#pragma GCC diagnostic pop
247#if defined(__STDCPP_FLOAT16_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
248 __attribute__((__always_inline__))
256#if defined(__STDCPP_FLOAT32_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
257 __attribute__((__always_inline__))
265#if defined(__STDCPP_FLOAT64_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
266 __attribute__((__always_inline__))
274#if defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128)
275 __attribute__((__always_inline__))
283#if defined(__STDCPP_BFLOAT16_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
284 __attribute__((__always_inline__))
304#if __cplusplus >= 201703L
307 {
return *
this <<
"nullptr"; }
310#if __cplusplus > 202002L
311 __attribute__((__always_inline__))
314 {
return _M_insert(
const_cast<const void*
>(__p)); }
443#if __cplusplus >= 201103L
469 template<
typename _ValueT>
474#if !_GLIBCXX_INLINE_VERSION
477 { std::__ostream_insert(*
this, __s, __n); }
480#pragma GCC diagnostic push
481#pragma GCC diagnostic ignored "-Wc++17-extensions"
482 template<
typename _To,
typename _From>
486 _To __d =
static_cast<_To
>(__f);
491#if __cpp_constexpr && __has_builtin(__builtin_bit_cast)
492 if constexpr (
sizeof(__f) ==
sizeof(short))
493 __sign =
static_cast<_To
>(__builtin_bit_cast(
short, __f));
494 else if constexpr (
sizeof(__f) ==
sizeof(
int))
495 __sign =
static_cast<_To
>(__builtin_bit_cast(
int, __f));
496 else if constexpr (
sizeof(__f) ==
sizeof(
long long))
497 __sign =
static_cast<_To
>(__builtin_bit_cast(
long long, __f));
500 __sign = __builtin_signbit(__f) ? _To(-1.0) : _To(+1.0);
502 if _GLIBCXX_CONSTEXPR (__is_same(_To,
double))
503 __d = __builtin_copysign(__d, __sign);
504 else if _GLIBCXX_CONSTEXPR (__is_same(_To,
long double))
505 __d = __builtin_copysignl(__d, __sign);
509#pragma GCC diagnostic pop
521#pragma GCC diagnostic push
522#pragma GCC diagnostic ignored "-Wc++11-extensions"
525#pragma GCC diagnostic pop
540 template <
typename _CharT,
typename _Traits>
562#pragma GCC diagnostic push
563#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
578 && !uncaught_exception())
585 if (
_M_os.rdbuf() &&
_M_os.rdbuf()->pubsync() == -1)
592#pragma GCC diagnostic pop
601#if __cplusplus >= 201103L
624 template<
typename _CharT,
typename _Traits>
628 if (__out.
width() != 0)
629 return __ostream_insert(__out, &__c, 1);
634 template<
typename _CharT,
typename _Traits>
635 inline basic_ostream<_CharT, _Traits>&
636 operator<<(basic_ostream<_CharT, _Traits>& __out,
char __c)
637 {
return (__out << __out.widen(__c)); }
640 template<
typename _Traits>
644 if (__out.width() != 0)
645 return __ostream_insert(__out, &__c, 1);
651 template<
typename _Traits>
654 {
return (__out <<
static_cast<char>(__c)); }
656 template<
typename _Traits>
659 {
return (__out <<
static_cast<char>(__c)); }
661#if __cplusplus > 201703L
665 template<
typename _Traits>
669#ifdef _GLIBCXX_USE_CHAR8_T
670 template<
typename _Traits>
675 template<
typename _Traits>
679 template<
typename _Traits>
683#ifdef _GLIBCXX_USE_WCHAR_T
684#ifdef _GLIBCXX_USE_CHAR8_T
685 template<
typename _Traits>
690 template<
typename _Traits>
694 template<
typename _Traits>
715 template<
typename _CharT,
typename _Traits>
722 __ostream_insert(__out, __s,
723 static_cast<streamsize>(_Traits::length(__s)));
727 template<
typename _CharT,
typename _Traits>
732 template<
typename _Traits>
739 __ostream_insert(__out, __s,
740 static_cast<streamsize>(_Traits::length(__s)));
745 template<
typename _Traits>
748 {
return (__out <<
reinterpret_cast<const char*
>(__s)); }
750 template<
typename _Traits>
753 {
return (__out <<
reinterpret_cast<const char*
>(__s)); }
755#if __cplusplus > 201703L
759 template<
typename _Traits>
763#ifdef _GLIBCXX_USE_CHAR8_T
764 template<
typename _Traits>
769 template<
typename _Traits>
773 template<
typename _Traits>
777#ifdef _GLIBCXX_USE_WCHAR_T
778#ifdef _GLIBCXX_USE_CHAR8_T
779 template<
typename _Traits>
784 template<
typename _Traits>
788 template<
typename _Traits>
795#if __cplusplus >= 201103L
800#if __cpp_concepts >= 201907L && __glibcxx_type_trait_variable_templates
802 template<
typename _Tp>
804 && (!is_same_v<_Tp, ios_base>)
805 &&
requires (_Tp* __t,
ios_base* __b) { __b = __t; };
807 template<
typename _Os,
typename _Tp>
809 &&
requires (_Os& __os,
const _Tp& __t) { __os << __t; }
812 template<
typename _Tp>
813 using _Require_derived_from_ios_base
817 template<
typename _Os,
typename _Tp,
818 typename = _Require_derived_from_ios_base<_Os>,
834 template<
typename _Ostream,
typename _Tp>
#define _GLIBCXX_VISIBILITY(V)
#define _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_BEGIN_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.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
decltype(nullptr) nullptr_t
_Os && __rvalue_stream_insertion_t
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
ISO C++ entities toplevel namespace is std.
void init(basic_streambuf< _CharT, _Traits > *__sb)
All setup is performed here.
void swap(basic_ios &__rhs) noexcept
void move(basic_ios &__rhs)
basic_ios(basic_streambuf< _CharT, _Traits > *__sb)
Constructor performs initialization.
The actual work of input and output (interface).
__ostream_type & write(const char_type *__s, streamsize __n)
Character string insertion.
num_put< char_type, ostreambuf_iterator< char_type, traits_type > > __num_put_type
void swap(basic_ostream &__rhs)
basic_ios< char_type, traits_type > __ios_type
basic_ostream(basic_iostream< _CharT, _Traits > &)
pos_type tellp()
Getting the current write position.
basic_ostream(basic_ostream &&__rhs)
traits_type::off_type off_type
__ostream_type & _M_insert(_ValueT __v)
__ostream_type & seekp(off_type, ios_base::seekdir)
Changing the current write position.
basic_ostream & operator=(const basic_ostream &)=delete
ctype< char_type > __ctype_type
basic_ostream(const basic_ostream &)=delete
__ostream_type & put(char_type __c)
Simple insertion.
static _To _S_cast_flt(_From __f)
basic_streambuf< char_type, traits_type > __streambuf_type
basic_ostream< char_type, traits_type > __ostream_type
traits_type::pos_type pos_type
basic_ostream & operator=(basic_ostream &&__rhs)
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)
virtual ~basic_ostream()
Base destructor.
__ostream_type & operator<<(__ostream_type &(*__pf)(__ostream_type &))
Interface for manipulators.
traits_type::int_type int_type
Template class basic_ostream.
Template class basic_iostream.
_Ios_Iostate iostate
This is a bitmask type.
static const iostate goodbit
Indicates all is well.
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.
The base of the I/O class hierarchy.
Primary class template ctype facet.
Primary class template num_put.
const ios_base::iostate _M_exception
_Disable_exceptions & operator=(const _Disable_exceptions &)=delete
_Disable_exceptions(const _Disable_exceptions &)=delete
_Disable_exceptions(basic_ostream &__os)
~sentry()
Possibly flushes the stream.
basic_ostream< _CharT, _Traits > & _M_os
sentry(basic_ostream< _CharT, _Traits > &__os)
The constructor performs preparatory work.