PNG  IHDR  8] PLTE S =tRNS   PNG  IHDR  8] PLTE S =tRNS   REDROOM
PHP 7.4.33
Preview: ostream Size: 30.45 KB
//opt/rh/gcc-toolset-14/root/usr/include/c++/14/ostream

// Output streams -*- C++ -*-

// Copyright (C) 1997-2024 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file include/ostream
 *  This is a Standard C++ Library header.
 */

//
// ISO C++ 14882: 27.6.2  Output streams
//

#ifndef _GLIBCXX_OSTREAM
#define _GLIBCXX_OSTREAM 1

#pragma GCC system_header

#include <bits/requires_hosted.h> // iostreams

#include <ios>
#include <bits/ostream_insert.h>
#if __cplusplus > 202002L
# include <format>
#endif

# define __glibcxx_want_print
#include <bits/version.h> // __glibcxx_syncbuf

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

  /**
   *  @brief  Template class basic_ostream.
   *  @ingroup io
   *
   *  @tparam _CharT  Type of character stream.
   *  @tparam _Traits  Traits for character type, defaults to
   *                   char_traits<_CharT>.
   *
   *  This is the base class for all output streams.  It provides text
   *  formatting of all builtin types, and communicates with any class
   *  derived from basic_streambuf to do the actual output.
  */
  template<typename _CharT, typename _Traits>
    class basic_ostream : virtual public basic_ios<_CharT, _Traits>
    {
    public:
      // Types (inherited from basic_ios):
      typedef _CharT			 		char_type;
      typedef typename _Traits::int_type 		int_type;
      typedef typename _Traits::pos_type 		pos_type;
      typedef typename _Traits::off_type 		off_type;
      typedef _Traits			 		traits_type;

      // Non-standard Types:
      typedef basic_streambuf<_CharT, _Traits> 		__streambuf_type;
      typedef basic_ios<_CharT, _Traits>		__ios_type;
      typedef basic_ostream<_CharT, _Traits>		__ostream_type;
      typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
      							__num_put_type;
      typedef ctype<_CharT>	      			__ctype_type;

      /**
       *  @brief  Base constructor.
       *
       *  This ctor is almost never called by the user directly, rather from
       *  derived classes' initialization lists, which pass a pointer to
       *  their own stream buffer.
      */
      explicit
      basic_ostream(__streambuf_type* __sb)
      { this->init(__sb); }

      /**
       *  @brief  Base destructor.
       *
       *  This does very little apart from providing a virtual base dtor.
      */
      virtual
      ~basic_ostream() { }

      /// Safe prefix/suffix operations.
      class sentry;
      friend class sentry;

      ///@{
      /**
       *  @brief  Interface for manipulators.
       *
       *  Manipulators such as @c std::endl and @c std::hex use these
       *  functions in constructs like "std::cout << std::endl".  For more
       *  information, see the iomanip header.
      */
      __ostream_type&
      operator<<(__ostream_type& (*__pf)(__ostream_type&))
      {
	// _GLIBCXX_RESOLVE_LIB_DEFECTS
	// DR 60. What is a formatted input function?
	// The inserters for manipulators are *not* formatted output functions.
	return __pf(*this);
      }

      __ostream_type&
      operator<<(__ios_type& (*__pf)(__ios_type&))
      {
	// _GLIBCXX_RESOLVE_LIB_DEFECTS
	// DR 60. What is a formatted input function?
	// The inserters for manipulators are *not* formatted output functions.
	__pf(*this);
	return *this;
      }

      __ostream_type&
      operator<<(ios_base& (*__pf) (ios_base&))
      {
	// _GLIBCXX_RESOLVE_LIB_DEFECTS
	// DR 60. What is a formatted input function?
	// The inserters for manipulators are *not* formatted output functions.
	__pf(*this);
	return *this;
      }
      ///@}

      ///@{
      /**
       *  @name Inserters
       *
       *  All the @c operator<< functions (aka <em>formatted output
       *  functions</em>) have some common behavior.  Each starts by
       *  constructing a temporary object of type std::basic_ostream::sentry.
       *  This can have several effects, concluding with the setting of a
       *  status flag; see the sentry documentation for more.
       *
       *  If the sentry status is good, the function tries to generate
       *  whatever data is appropriate for the type of the argument.
       *
       *  If an exception is thrown during insertion, ios_base::badbit
       *  will be turned on in the stream's error state without causing an
       *  ios_base::failure to be thrown.  The original exception will then
       *  be rethrown.
      */

      ///@{
      /**
       *  @brief Integer arithmetic inserters
       *  @param  __n A variable of builtin integral type.
       *  @return  @c *this if successful
       *
       *  These functions use the stream's current locale (specifically, the
       *  @c num_get facet) to perform numeric formatting.
      */
      __ostream_type&
      operator<<(long __n)
      { return _M_insert(__n); }

      __ostream_type&
      operator<<(unsigned long __n)
      { return _M_insert(__n); }

      __ostream_type&
      operator<<(bool __n)
      { return _M_insert(__n); }

      __ostream_type&
      operator<<(short __n);

      __ostream_type&
      operator<<(unsigned short __n)
      {
	// _GLIBCXX_RESOLVE_LIB_DEFECTS
	// 117. basic_ostream uses nonexistent num_put member functions.
	return _M_insert(static_cast<unsigned long>(__n));
      }

      __ostream_type&
      operator<<(int __n);

      __ostream_type&
      operator<<(unsigned int __n)
      {
	// _GLIBCXX_RESOLVE_LIB_DEFECTS
	// 117. basic_ostream uses nonexistent num_put member functions.
	return _M_insert(static_cast<unsigned long>(__n));
      }

#ifdef _GLIBCXX_USE_LONG_LONG
      __ostream_type&
      operator<<(long long __n)
      { return _M_insert(__n); }

      __ostream_type&
      operator<<(unsigned long long __n)
      { return _M_insert(__n); }
#endif
      ///@}

      ///@{
      /**
       *  @brief  Floating point arithmetic inserters
       *  @param  __f A variable of builtin floating point type.
       *  @return  @c *this if successful
       *
       *  These functions use the stream's current locale (specifically, the
       *  @c num_get facet) to perform numeric formatting.
      */
      __ostream_type&
      operator<<(double __f)
      { return _M_insert(__f); }

      __ostream_type&
      operator<<(float __f)
      {
	// _GLIBCXX_RESOLVE_LIB_DEFECTS
	// 117. basic_ostream uses nonexistent num_put member functions.
	return _M_insert(static_cast<double>(__f));
      }

      __ostream_type&
      operator<<(long double __f)
      { return _M_insert(__f); }
      ///@}

#if defined(__STDCPP_FLOAT16_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
      __attribute__((__always_inline__))
      __ostream_type&
      operator<<(_Float16 __f)
      {
	return _M_insert(static_cast<double>(__f));
      }
#endif

#if defined(__STDCPP_FLOAT32_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
      __attribute__((__always_inline__))
      __ostream_type&
      operator<<(_Float32 __f)
      {
	return _M_insert(static_cast<double>(__f));
      }
#endif

#if defined(__STDCPP_FLOAT64_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
      __attribute__((__always_inline__))
      __ostream_type&
      operator<<(_Float64 __f)
      {
	return _M_insert(static_cast<double>(__f));
      }
#endif

#if defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128)
      __attribute__((__always_inline__))
      __ostream_type&
      operator<<(_Float128 __f)
      {
	return _M_insert(static_cast<long double>(__f));
      }
#endif

#if defined(__STDCPP_BFLOAT16_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
      __attribute__((__always_inline__))
      __ostream_type&
      operator<<(__gnu_cxx::__bfloat16_t __f)
      {
	return _M_insert(static_cast<double>(__f));
      }
#endif

      /**
       *  @brief  Pointer arithmetic inserters
       *  @param  __p A variable of pointer type.
       *  @return  @c *this if successful
       *
       *  These functions use the stream's current locale (specifically, the
       *  @c num_get facet) to perform numeric formatting.
      */
      __ostream_type&
      operator<<(const void* __p)
      { return _M_insert(__p); }

#if __cplusplus >= 201703L
      __ostream_type&
      operator<<(nullptr_t)
      { return *this << "nullptr"; }
#endif

#if __cplusplus > 202002L
      __attribute__((__always_inline__))
      __ostream_type&
      operator<<(const volatile void* __p)
      { return _M_insert(const_cast<const void*>(__p)); }
#endif

      /**
       *  @brief  Extracting from another streambuf.
       *  @param  __sb  A pointer to a streambuf
       *
       *  This function behaves like one of the basic arithmetic extractors,
       *  in that it also constructs a sentry object and has the same error
       *  handling behavior.
       *
       *  If @p __sb is NULL, the stream will set failbit in its error state.
       *
       *  Characters are extracted from @p __sb and inserted into @c *this
       *  until one of the following occurs:
       *
       *  - the input stream reaches end-of-file,
       *  - insertion into the output sequence fails (in this case, the
       *    character that would have been inserted is not extracted), or
       *  - an exception occurs while getting a character from @p __sb, which
       *    sets failbit in the error state
       *
       *  If the function inserts no characters, failbit is set.
      */
      __ostream_type&
      operator<<(__streambuf_type* __sb);
      ///@}

      ///@{
      /**
       *  @name Unformatted Output Functions
       *
       *  All the unformatted output functions have some common behavior.
       *  Each starts by constructing a temporary object of type
       *  std::basic_ostream::sentry.  This has several effects, concluding
       *  with the setting of a status flag; see the sentry documentation
       *  for more.
       *
       *  If the sentry status is good, the function tries to generate
       *  whatever data is appropriate for the type of the argument.
       *
       *  If an exception is thrown during insertion, ios_base::badbit
       *  will be turned on in the stream's error state.  If badbit is on in
       *  the stream's exceptions mask, the exception will be rethrown
       *  without completing its actions.
      */

      /**
       *  @brief  Simple insertion.
       *  @param  __c  The character to insert.
       *  @return  *this
       *
       *  Tries to insert @p __c.
       *
       *  @note  This function is not overloaded on signed char and
       *         unsigned char.
      */
      __ostream_type&
      put(char_type __c);

      /**
       *  @brief  Character string insertion.
       *  @param  __s  The array to insert.
       *  @param  __n  Maximum number of characters to insert.
       *  @return  *this
       *
       *  Characters are copied from @p __s and inserted into the stream until
       *  one of the following happens:
       *
       *  - @p __n characters are inserted
       *  - inserting into the output sequence fails (in this case, badbit
       *    will be set in the stream's error state)
       *
       *  @note  This function is not overloaded on signed char and
       *         unsigned char.
      */
      __ostream_type&
      write(const char_type* __s, streamsize __n);
      ///@}

      /**
       *  @brief  Synchronizing the stream buffer.
       *  @return  *this
       *
       *  If @c rdbuf() is a null pointer, changes nothing.
       *
       *  Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1,
       *  sets badbit.
      */
      __ostream_type&
      flush();

      /**
       *  @brief  Getting the current write position.
       *  @return  A file position object.
       *
       *  If @c fail() is not false, returns @c pos_type(-1) to indicate
       *  failure.  Otherwise returns @c rdbuf()->pubseekoff(0,cur,out).
      */
      pos_type
      tellp();

      /**
       *  @brief  Changing the current write position.
       *  @param  __pos  A file position object.
       *  @return  *this
       *
       *  If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos).  If
       *  that function fails, sets failbit.
      */
      __ostream_type&
      seekp(pos_type);

      /**
       *  @brief  Changing the current write position.
       *  @param  __off  A file offset object.
       *  @param  __dir  The direction in which to seek.
       *  @return  *this
       *
       *  If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir).
       *  If that function fails, sets failbit.
      */
       __ostream_type&
      seekp(off_type, ios_base::seekdir);

    protected:
      basic_ostream()
      { this->init(0); }

#if __cplusplus >= 201103L
      // Non-standard constructor that does not call init()
      basic_ostream(basic_iostream<_CharT, _Traits>&) { }

      basic_ostream(const basic_ostream&) = delete;

      basic_ostream(basic_ostream&& __rhs)
      : __ios_type()
      { __ios_type::move(__rhs); }

      // 27.7.3.3 Assign/swap

      basic_ostream& operator=(const basic_ostream&) = delete;

      basic_ostream&
      operator=(basic_ostream&& __rhs)
      {
	swap(__rhs);
	return *this;
      }

      void
      swap(basic_ostream& __rhs)
      { __ios_type::swap(__rhs); }
#endif

      template<typename _ValueT>
	__ostream_type&
	_M_insert(_ValueT __v);

    private:
#if !_GLIBCXX_INLINE_VERSION
      void
      _M_write(const char_type* __s, streamsize __n)
      { std::__ostream_insert(*this, __s, __n); }
#endif
    };

  /**
   *  @brief  Performs setup work for output streams.
   *
   *  Objects of this class are created before all of the standard
   *  inserters are run.  It is responsible for <em>exception-safe prefix and
   *  suffix operations</em>.
  */
  template <typename _CharT, typename _Traits>
    class basic_ostream<_CharT, _Traits>::sentry
    {
      // Data Members.
      bool 				_M_ok;
      basic_ostream<_CharT, _Traits>& 	_M_os;

    public:
      /**
       *  @brief  The constructor performs preparatory work.
       *  @param  __os  The output stream to guard.
       *
       *  If the stream state is good (@a __os.good() is true), then if the
       *  stream is tied to another output stream, @c is.tie()->flush()
       *  is called to synchronize the output sequences.
       *
       *  If the stream state is still good, then the sentry state becomes
       *  true (@a okay).
      */
      explicit
      sentry(basic_ostream<_CharT, _Traits>& __os);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
      /**
       *  @brief  Possibly flushes the stream.
       *
       *  If @c ios_base::unitbuf is set in @c os.flags(), and
       *  @c std::uncaught_exception() is true, the sentry destructor calls
       *  @c flush() on the output stream.
      */
      ~sentry()
      {
	// XXX MT
	if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception())
	  {
	    // Can't call flush directly or else will get into recursive lock.
	    if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
	      _M_os.setstate(ios_base::badbit);
	  }
      }
#pragma GCC diagnostic pop

      /**
       *  @brief  Quick status checking.
       *  @return  The sentry state.
       *
       *  For ease of use, sentries may be converted to booleans.  The
       *  return value is that of the sentry state (true == okay).
      */
#if __cplusplus >= 201103L
      explicit
#endif
      operator bool() const
      { return _M_ok; }
    };

  ///@{
  /**
   *  @brief  Character inserters
   *  @param  __out  An output stream.
   *  @param  __c  A character.
   *  @return  out
   *
   *  Behaves like one of the formatted arithmetic inserters described in
   *  std::basic_ostream.  After constructing a sentry object with good
   *  status, this function inserts a single character and any required
   *  padding (as determined by [22.2.2.2.2]).  @c __out.width(0) is then
   *  called.
   *
   *  If @p __c is of type @c char and the character type of the stream is not
   *  @c char, the character is widened before insertion.
  */
  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    {
      if (__out.width() != 0)
	return __ostream_insert(__out, &__c, 1);
      __out.put(__c);
      return __out;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    { return (__out << __out.widen(__c)); }

  // Specialization
  template<typename _Traits>
    inline basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    {
      if (__out.width() != 0)
	return __ostream_insert(__out, &__c, 1);
      __out.put(__c);
      return __out;
    }

  // Signed and unsigned
  template<typename _Traits>
    inline basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    { return (__out << static_cast<char>(__c)); }

  template<typename _Traits>
    inline basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    { return (__out << static_cast<char>(__c)); }

#if __cplusplus > 201703L
  // The following deleted overloads prevent formatting character values as
  // numeric values.

  template<typename _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete;

#ifdef _GLIBCXX_USE_CHAR8_T
  template<typename _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
#endif

  template<typename _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>&, char16_t) = delete;

  template<typename _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>&, char32_t) = delete;

#ifdef _GLIBCXX_USE_WCHAR_T
#ifdef _GLIBCXX_USE_CHAR8_T
  template<typename _Traits>
    basic_ostream<wchar_t, _Traits>&
    operator<<(basic_ostream<wchar_t, _Traits>&, char8_t) = delete;
#endif // _GLIBCXX_USE_CHAR8_T

  template<typename _Traits>
    basic_ostream<wchar_t, _Traits>&
    operator<<(basic_ostream<wchar_t, _Traits>&, char16_t) = delete;

  template<typename _Traits>
    basic_ostream<wchar_t, _Traits>&
    operator<<(basic_ostream<wchar_t, _Traits>&, char32_t) = delete;
#endif // _GLIBCXX_USE_WCHAR_T
#endif // C++20
  ///@}

  ///@{
  /**
   *  @brief  String inserters
   *  @param  __out  An output stream.
   *  @param  __s  A character string.
   *  @return  out
   *  @pre  @p __s must be a non-NULL pointer
   *
   *  Behaves like one of the formatted arithmetic inserters described in
   *  std::basic_ostream.  After constructing a sentry object with good
   *  status, this function inserts @c traits::length(__s) characters starting
   *  at @p __s, widened if necessary, followed by any required padding (as
   *  determined by [22.2.2.2.2]).  @c __out.width(0) is then called.
  */
  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    {
      if (!__s)
	__out.setstate(ios_base::badbit);
      else
	__ostream_insert(__out, __s,
			 static_cast<streamsize>(_Traits::length(__s)));
      return __out;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits> &
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);

  // Partial specializations
  template<typename _Traits>
    inline basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    {
      if (!__s)
	__out.setstate(ios_base::badbit);
      else
	__ostream_insert(__out, __s,
			 static_cast<streamsize>(_Traits::length(__s)));
      return __out;
    }

  // Signed and unsigned
  template<typename _Traits>
    inline basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    { return (__out << reinterpret_cast<const char*>(__s)); }

  template<typename _Traits>
    inline basic_ostream<char, _Traits> &
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    { return (__out << reinterpret_cast<const char*>(__s)); }

#if __cplusplus > 201703L
   // The following deleted overloads prevent formatting strings as
   // pointer values.

  template<typename _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete;

#ifdef _GLIBCXX_USE_CHAR8_T
  template<typename _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>&, const char8_t*) = delete;
#endif // _GLIBCXX_USE_CHAR8_T

  template<typename _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>&, const char16_t*) = delete;

  template<typename _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete;

#ifdef _GLIBCXX_USE_WCHAR_T
#ifdef _GLIBCXX_USE_CHAR8_T
  template<typename _Traits>
    basic_ostream<wchar_t, _Traits>&
    operator<<(basic_ostream<wchar_t, _Traits>&, const char8_t*) = delete;
#endif

  template<typename _Traits>
    basic_ostream<wchar_t, _Traits>&
    operator<<(basic_ostream<wchar_t, _Traits>&, const char16_t*) = delete;

  template<typename _Traits>
    basic_ostream<wchar_t, _Traits>&
    operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete;
#endif // _GLIBCXX_USE_WCHAR_T
#endif // C++20
  ///@}

  // Standard basic_ostream manipulators

  /**
   *  @brief  Write a newline and flush the stream.
   *
   *  This manipulator is often mistakenly used when a simple newline is
   *  desired, leading to poor buffering performance.  See
   *  https://gcc.gnu.org/onlinedocs/libstdc++/manual/streambufs.html#io.streambuf.buffering
   *  for more on this subject.
  */
  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    endl(basic_ostream<_CharT, _Traits>& __os)
    { return flush(__os.put(__os.widen('\n'))); }

  /**
   *  @brief  Write a null character into the output sequence.
   *
   *  <em>Null character</em> is @c CharT() by definition.  For CharT
   *  of @c char, this correctly writes the ASCII @c NUL character
   *  string terminator.
  */
  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    ends(basic_ostream<_CharT, _Traits>& __os)
    { return __os.put(_CharT()); }

  /**
   *  @brief  Flushes the output stream.
   *
   *  This manipulator simply calls the stream's @c flush() member function.
  */
  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    flush(basic_ostream<_CharT, _Traits>& __os)
    { return __os.flush(); }

#if __cplusplus >= 201103L
  // C++11 27.7.3.9 Rvalue stream insertion [ostream.rvalue]
  // _GLIBCXX_RESOLVE_LIB_DEFECTS
  // 1203. More useful rvalue stream insertion

#if __cpp_concepts >= 201907L && __glibcxx_type_trait_variable_templates
  // Use concepts if possible because they're cheaper to evaluate.
  template<typename _Tp>
    concept __derived_from_ios_base = is_class_v<_Tp>
      && (!is_same_v<_Tp, ios_base>)
      && requires (_Tp* __t, ios_base* __b) { __b = __t; };

  template<typename _Os, typename _Tp>
    requires __derived_from_ios_base<_Os>
      && requires (_Os& __os, const _Tp& __t) { __os << __t; }
    using __rvalue_stream_insertion_t = _Os&&;
#else
  template<typename _Tp>
    using _Require_derived_from_ios_base
      = _Require<is_class<_Tp>, __not_<is_same<_Tp, ios_base>>,
		 is_convertible<typename add_pointer<_Tp>::type, ios_base*>>;

  template<typename _Os, typename _Tp,
	   typename = _Require_derived_from_ios_base<_Os>,
	   typename
	     = decltype(std::declval<_Os&>() << std::declval<const _Tp&>())>
    using __rvalue_stream_insertion_t = _Os&&;
#endif

  /**
   *  @brief  Generic inserter for rvalue stream
   *  @param  __os  An input stream.
   *  @param  __x  A reference to the object being inserted.
   *  @return  __os
   *
   *  This is just a forwarding function to allow insertion to
   *  rvalue streams since they won't bind to the inserter functions
   *  that take an lvalue reference.
  */
  template<typename _Ostream, typename _Tp>
    inline __rvalue_stream_insertion_t<_Ostream, _Tp>
    operator<<(_Ostream&& __os, const _Tp& __x)
    {
      __os << __x;
      return std::move(__os);
    }

#ifdef __glibcxx_syncbuf // C++ >= 20 && HOSTED && CXX11ABI
  template<typename _CharT, typename _Traits>
    class __syncbuf_base : public basic_streambuf<_CharT, _Traits>
    {
    public:
      static bool*
      _S_get(basic_streambuf<_CharT, _Traits>* __buf [[maybe_unused]]) noexcept
      {
#if __cpp_rtti
	if (auto __p = dynamic_cast<__syncbuf_base*>(__buf))
	  return &__p->_M_emit_on_sync;
#endif
	return nullptr;
      }

    protected:
      __syncbuf_base(basic_streambuf<_CharT, _Traits>* __w = nullptr)
      : _M_wrapped(__w)
      { }

      basic_streambuf<_CharT, _Traits>* _M_wrapped = nullptr;
      bool _M_emit_on_sync = false;
      bool _M_needs_sync = false;
    };

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    emit_on_flush(basic_ostream<_CharT, _Traits>& __os)
    {
      if (bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
	*__flag = true;
      return __os;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    noemit_on_flush(basic_ostream<_CharT, _Traits>& __os)
    {
      if (bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
	*__flag = false;
      return __os;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    flush_emit(basic_ostream<_CharT, _Traits>& __os)
    {
      struct _Restore
      {
	~_Restore() { *_M_flag = _M_prev; }

	bool _M_prev = false;
	bool* _M_flag = &_M_prev;
      } __restore;

      if (bool* __flag = __syncbuf_base<_CharT, _Traits>::_S_get(__os.rdbuf()))
	{
	  __restore._M_prev = *__flag;
	  __restore._M_flag = __flag;
	  *__flag = true;
	}

      __os.flush();
      return __os;
    }
#endif // __glibcxx_syncbuf

#if __cpp_lib_print // C++ >= 23

  inline void
  vprint_nonunicode(ostream& __os, string_view __fmt, format_args __args)
  {
    ostream::sentry __cerb(__os);
    if (__cerb)
      {
	__format::_Str_sink<char> __buf;
	std::vformat_to(__buf.out(), __os.getloc(), __fmt, __args);
	auto __out = __buf.view();

	__try
	  {
	    std::__ostream_write(__os, __out.data(), __out.size());
	  }
	__catch(const __cxxabiv1::__forced_unwind&)
	  {
	    __os._M_setstate(ios_base::badbit);
	    __throw_exception_again;
	  }
	__catch(...)
	  { __os._M_setstate(ios_base::badbit); }
      }
  }

  inline void
  vprint_unicode(ostream& __os, string_view __fmt, format_args __args)
  {
#if !defined(_WIN32) || defined(__CYGWIN__)
    // For most targets we don't need to do anything special to write
    // Unicode to a terminal.
    std::vprint_nonunicode(__os, __fmt, __args);
#else
    ostream::sentry __cerb(__os);
    if (__cerb)
      {
	__format::_Str_sink<char> __buf;
	std::vformat_to(__buf.out(), __os.getloc(), __fmt, __args);
	auto __out = __buf.view();

	void* __open_terminal(streambuf*);
	error_code __write_to_terminal(void*, span<char>);
	// If stream refers to a terminal, write a Unicode string to it.
	if (auto __term = __open_terminal(__os.rdbuf()))
	  {
#if !defined(_WIN32) || defined(__CYGWIN__)
	    // For POSIX, __open_terminal(streambuf*) uses fdopen to open a
	    // new file, so we would need to close it here. This code is not
	    // actually compiled because it's inside an #ifdef _WIN32 group,
	    // but just in case that changes in future ...
	    struct _Guard
	    {
	      _Guard(void* __p) : _M_f((FILE*)__p) { }
	      ~_Guard() { std::fclose(_M_f); }
	      _Guard(_Guard&&) = delete;
	      _Guard& operator=(_Guard&&) = delete;
	      FILE* _M_f;
	    };
	    _Guard __g(__term);
#endif

	    ios_base::iostate __err = ios_base::goodbit;
	    __try
	      {
		if (__os.rdbuf()->pubsync() == -1)
		  __err = ios::badbit;
		else if (auto __e = __write_to_terminal(__term, __out))
		  if (__e != std::make_error_code(errc::illegal_byte_sequence))
		    __err = ios::badbit;
	      }
	    __catch(const __cxxabiv1::__forced_unwind&)
	      {
		__os._M_setstate(ios_base::badbit);
		__throw_exception_again;
	      }
	    __catch(...)
	      { __os._M_setstate(ios_base::badbit); }

	    if (__err)
	      __os.setstate(__err);
	    return;
	  }

	// Otherwise just insert the string as vprint_nonunicode does.
	__try
	  {
	    std::__ostream_write(__os, __out.data(), __out.size());
	  }
	__catch(const __cxxabiv1::__forced_unwind&)
	  {
	    __os._M_setstate(ios_base::badbit);
	    __throw_exception_again;
	  }
	__catch(...)
	  { __os._M_setstate(ios_base::badbit); }
      }
#endif // _WIN32
  }

  template<typename... _Args>
    inline void
    print(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args)
    {
      auto __fmtargs = std::make_format_args(__args...);
      if constexpr (__unicode::__literal_encoding_is_utf8())
	std::vprint_unicode(__os, __fmt.get(), __fmtargs);
      else
	std::vprint_nonunicode(__os, __fmt.get(), __fmtargs);
    }

  template<typename... _Args>
    inline void
    println(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args)
    {
      // _GLIBCXX_RESOLVE_LIB_DEFECTS
      // 4088. println ignores the locale imbued in std::ostream
      std::print(__os, "{}\n", std::format(__os.getloc(), __fmt,
					   std::forward<_Args>(__args)...));
    }

  // Defined for C++26, supported as an extension to C++23.
  inline void println(ostream& __os)
  {
#if defined(_WIN32) && !defined(__CYGWIN__)
    if constexpr (__unicode::__literal_encoding_is_utf8())
      std::vprint_unicode(__os, "\n", std::make_format_args());
    else
#endif
      __os.put('\n');
  }

#endif // __cpp_lib_print

#endif // C++11

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std

#include <bits/ostream.tcc>

#endif	/* _GLIBCXX_OSTREAM */

Directory Contents

Dirs: 11 × Files: 116

Name Size Perms Modified Actions
backward DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
bits DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
debug DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
decimal DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
ext DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
parallel DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
pstl DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
tr1 DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
tr2 DIR
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
- drwxr-xr-x 2026-04-30 11:58:47
Edit Download
3.31 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
18.71 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
15.40 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
51.16 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
7.87 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
14.00 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
49.19 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.61 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.30 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.34 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.73 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.00 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.84 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
29.13 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
94.45 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.09 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.43 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.87 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.86 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
94.84 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
5.15 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
37.25 KB lrw-r--r-- 2025-11-11 11:26:46
Edit Download
74.84 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.56 KB lrw-r--r-- 2025-11-11 11:26:45
Edit Download
12.72 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
12.59 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
9.39 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.90 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.81 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.37 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.82 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.37 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
6.54 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.75 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
4.33 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
6.66 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.17 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.33 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.24 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.84 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
6.39 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.73 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
21.77 KB lrw-r--r-- 2025-11-11 11:26:46
Edit Download
4.56 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
5.31 KB lrw-r--r-- 2025-11-11 11:26:46
Edit Download
1.87 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
49.81 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.96 KB lrw-r--r-- 2025-11-11 11:26:45
Edit Download
1.72 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
128.31 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.91 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
41.58 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
47.31 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
52.04 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
22.16 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.93 KB lrw-r--r-- 2025-11-11 11:26:46
Edit Download
16.40 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.67 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
8.21 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.02 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
35.52 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.02 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.70 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
82.01 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.86 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.50 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
4.37 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
4.47 KB lrw-r--r-- 2025-11-11 11:26:45
Edit Download
5.26 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
14.15 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
26.99 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
8.48 KB lrw-r--r-- 2025-11-11 11:26:46
Edit Download
6.91 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
25.50 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
44.03 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
30.45 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
4.73 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.54 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.63 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
271.83 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
22.26 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.16 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
17.41 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.04 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
4.16 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
24.60 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.70 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
14.12 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
12.20 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
38.83 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.46 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
21.82 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
4.02 KB lrw-r--r-- 2025-11-11 11:26:45
Edit Download
9.65 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.72 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
2.25 KB lrw-r--r-- 2025-11-11 11:26:45
Edit Download
15.72 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
29.24 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
4.23 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
27.46 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
8.18 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
17.96 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
16.26 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.33 KB lrw-r--r-- 2025-11-11 11:26:45
Edit Download
9.77 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
99.67 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.43 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
8.10 KB lrw-r--r-- 2025-11-11 11:26:46
Edit Download
118.15 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.69 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
3.48 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
7.38 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
40.20 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
64.81 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
4.98 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download
1.42 KB lrw-r--r-- 2025-11-11 11:26:44
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
 !"#$%&'(()*+,-./00123456789 t\ wIDATx ]ys  47Y ƒ -  "  Rv  < f{Ɛ $k l L > L  ~h^ 1  [  r G t& h  l F z3O Y ! p A(_g̷ E8 )S 8 c  Kb"z ~ 5 J xAL WU <  *  5 m;W a pB h ~P J 2 3 6 ҙ .Ƹ P i  4g F R L P ΪK/D  M v (a3 k J Œ4N5* SH ` SdJ z  O J Xՠ V>u ߱ BE&L b2 ?2` tX+  c CB A$ i b C ĀMB E : /  # Dx &l =q Ty  0 \p I ( L Ǎ { e 4k ;`u^ヲ eP!( d {  )T A 8 O;Ě n >;s6 !  :Nx `[S D HU ~ q›J F} a g*D 49 / pn k h (t 8NxƐF _!r չ7 ZR R׷ q/5") Ӎ NY 0 x sZ!   o  fu  ,  K"$ ? pg  㕣=  1» {h " fh7    y  } € +7  $ y " X —ą - G P u 4 m >J 5 L =V ' ^@I p ?MS xЌ XV P ! h "C NS9B8̢ ]!K  e   zA , ӏkbY  !< XQ ٿyS| *" f { w  4@[S <  # 0 ! js [m  =,~ o "ݎ DHf Wo $ g ! Vԅ t mB /y Wf V4񺍸 c+@x?  B ~u " xUN e 0 BĂ) ~J pz! 7y6]l Ԥ@ P a< O /DHC `≻  N m"$  0ObB }{ x AO FCG D R ^ "B  { WDH  UR l@ T #  +"d T ; 0 i  D}. 7 ` ' ] w rE &S i ƕiTD EL P _ u h $ Ա FG wVD G L R Zf ' .!] J /ZR oGЍs Mr Ĥ ʬ 3 Q [3 cL ` ^ p + ( F;# B 5 '  2Y f [  ϶R0e }  E 7 6M aۮ H <& n % L] E}Up x紉, Uw' Q  Ǯշo k ވۙ 0N94 VX5 xEDE l D #֤ } C o )W :  ^ s 9  bRf iX5u ཱི 4 :[  T 1. | [E 2ؽ Iy\ : o x K G 5 ylP ' uK E ftb/i[3 .g _  [3M n G, #NwQ5~  ؚ) | n =Ц"x qg gB ` 듘 ~ x w ? ? R~  _ u. &VQ K˻   H C ( TN˄+ `C dA nB׭ D 3"Z G ê ^k H_ /- ~ " R_  .8 Z_ 6@ o  xg  uP ? 3լ @7AM!  E7^ - =V L  x  g-D0  CtmW 7  O  G _ WD0 g C  w1 r d w : a | \  *" f nֳ ^ H# f L ` Z ۽hV  }S F r0Ù Bć5r] @! NL iQ]{s^=4 d  WD  "  "   M; t" 8 5 e dL| "-*st" ) SWD ?R[S e ooF  20.D ? bo =) A i o d ģ ZҰaO @E =) i D a &ܟa CϞ y6 ,<%{^x%{f8? `iw^ ?/ M * IEND B`