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

// <coroutine> -*- C++ -*-

// Copyright (C) 2019-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/coroutine
 *  This is a Standard C++ Library header.
 */

#ifndef _GLIBCXX_COROUTINE
#define _GLIBCXX_COROUTINE 1

#pragma GCC system_header

#define __glibcxx_want_coroutine
#include <bits/version.h>

#if !__cpp_impl_coroutine
# error "the <coroutine> header requires -fcoroutines"
#endif

#ifdef __cpp_lib_coroutine // C++ >= 14 && impl_coroutine

#include <type_traits>
#if __cplusplus > 201703L
# include <compare>
#endif

#if !defined __cpp_lib_three_way_comparison
# include <bits/stl_function.h> // for std::less
#endif

/**
 * @defgroup coroutines Coroutines
 *
 * Components for supporting coroutine implementations.
 *
 * @since C++20 (and since C++14 as a libstdc++ extension)
 */

namespace std _GLIBCXX_VISIBILITY (default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

  inline namespace __n4861 {

  // C++20 17.12.2 coroutine traits
  /// [coroutine.traits]
  /// [coroutine.traits.primary]
  /// If _Result::promise_type is valid and denotes a type then the traits
  /// have a single publicly accessible member, otherwise they are empty.
  template <typename _Result, typename... _ArgTypes>
    struct coroutine_traits;

  template <typename _Result, typename = void>
   struct __coroutine_traits_impl {};

  template <typename _Result>
#if __cpp_concepts
    requires requires { typename _Result::promise_type; }
    struct __coroutine_traits_impl<_Result, void>
#else
    struct __coroutine_traits_impl<_Result,
				   __void_t<typename _Result::promise_type>>
#endif
    {
      using promise_type = typename _Result::promise_type;
    };

  template <typename _Result, typename... _ArgTypes>
    struct coroutine_traits : __coroutine_traits_impl<_Result> {};

  // C++20 17.12.3 Class template coroutine_handle
  /// [coroutine.handle]
  template <typename _Promise = void>
    struct coroutine_handle;

  template <> struct
    coroutine_handle<void>
    {
    public:
      // [coroutine.handle.con], construct/reset
      constexpr coroutine_handle() noexcept : _M_fr_ptr(nullptr) {}

      constexpr coroutine_handle(std::nullptr_t __h) noexcept
	: _M_fr_ptr(__h)
      {}

      coroutine_handle& operator=(std::nullptr_t) noexcept
      {
	_M_fr_ptr = nullptr;
	return *this;
      }

    public:
      // [coroutine.handle.export.import], export/import
      constexpr void* address() const noexcept { return _M_fr_ptr; }

      constexpr static coroutine_handle from_address(void* __a) noexcept
      {
	coroutine_handle __self;
	__self._M_fr_ptr = __a;
	return __self;
      }

    public:
      // [coroutine.handle.observers], observers
      constexpr explicit operator bool() const noexcept
      {
	return bool(_M_fr_ptr);
      }

      bool done() const noexcept { return __builtin_coro_done(_M_fr_ptr); }

      // [coroutine.handle.resumption], resumption
      void operator()() const { resume(); }

      void resume() const { __builtin_coro_resume(_M_fr_ptr); }

      void destroy() const { __builtin_coro_destroy(_M_fr_ptr); }

    protected:
      void* _M_fr_ptr;
  };

  // [coroutine.handle.compare], comparison operators

  constexpr bool
  operator==(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
  {
    return __a.address() == __b.address();
  }

#ifdef __cpp_lib_three_way_comparison
  constexpr strong_ordering
  operator<=>(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
  {
    return std::compare_three_way()(__a.address(), __b.address());
  }
#else
  // These are to enable operation with std=c++14,17.
  constexpr bool
  operator!=(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
  {
    return !(__a == __b);
  }

  constexpr bool
  operator<(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
  {
    return less<void*>()(__a.address(), __b.address());
  }

  constexpr bool
  operator>(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
  {
    return __b < __a;
  }

  constexpr bool
  operator<=(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
  {
    return !(__a > __b);
  }

  constexpr bool
  operator>=(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
  {
    return !(__a < __b);
  }
#endif

  template <typename _Promise>
    struct coroutine_handle
    {
      // [coroutine.handle.con], construct/reset

      constexpr coroutine_handle() noexcept { }

      constexpr coroutine_handle(nullptr_t) noexcept { }

      static coroutine_handle
      from_promise(_Promise& __p)
      {
	coroutine_handle __self;
	__self._M_fr_ptr
	  = __builtin_coro_promise((char*) &__p, __alignof(_Promise), true);
	return __self;
      }

      coroutine_handle& operator=(nullptr_t) noexcept
      {
	_M_fr_ptr = nullptr;
	return *this;
      }

      // [coroutine.handle.export.import], export/import

      constexpr void* address() const noexcept { return _M_fr_ptr; }

      constexpr static coroutine_handle from_address(void* __a) noexcept
      {
	coroutine_handle __self;
	__self._M_fr_ptr = __a;
	return __self;
      }

      // [coroutine.handle.conv], conversion
      constexpr operator coroutine_handle<>() const noexcept
      { return coroutine_handle<>::from_address(address()); }

      // [coroutine.handle.observers], observers
      constexpr explicit operator bool() const noexcept
      {
	return bool(_M_fr_ptr);
      }

      bool done() const noexcept { return __builtin_coro_done(_M_fr_ptr); }

      // [coroutine.handle.resumption], resumption
      void operator()() const { resume(); }

      void resume() const { __builtin_coro_resume(_M_fr_ptr); }

      void destroy() const { __builtin_coro_destroy(_M_fr_ptr); }

      // [coroutine.handle.promise], promise access
      _Promise& promise() const
      {
	void* __t
	  = __builtin_coro_promise (_M_fr_ptr, __alignof(_Promise), false);
	return *static_cast<_Promise*>(__t);
      }

    private:
      void* _M_fr_ptr = nullptr;
    };

  /// [coroutine.noop]
  struct noop_coroutine_promise
  {
  };

  // 17.12.4.1 Class noop_coroutine_promise
  /// [coroutine.promise.noop]
  template <>
    struct coroutine_handle<noop_coroutine_promise>
    {
      // _GLIBCXX_RESOLVE_LIB_DEFECTS
      // 3460. Unimplementable noop_coroutine_handle guarantees
      // [coroutine.handle.noop.conv], conversion
      constexpr operator coroutine_handle<>() const noexcept
      { return coroutine_handle<>::from_address(address()); }

      // [coroutine.handle.noop.observers], observers
      constexpr explicit operator bool() const noexcept { return true; }

      constexpr bool done() const noexcept { return false; }

      // [coroutine.handle.noop.resumption], resumption
      void operator()() const noexcept {}

      void resume() const noexcept {}

      void destroy() const noexcept {}

      // [coroutine.handle.noop.promise], promise access
      noop_coroutine_promise& promise() const noexcept
      { return _S_fr.__p; }

      // [coroutine.handle.noop.address], address
      constexpr void* address() const noexcept { return _M_fr_ptr; }

    private:
      friend coroutine_handle noop_coroutine() noexcept;

      struct __frame
      {
	static void __dummy_resume_destroy() { }

	void (*__r)() = __dummy_resume_destroy;
	void (*__d)() = __dummy_resume_destroy;
	struct noop_coroutine_promise __p;
      };

      static __frame _S_fr;

      explicit coroutine_handle() noexcept = default;

      void* _M_fr_ptr = &_S_fr;
    };

  using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;

  inline noop_coroutine_handle::__frame
  noop_coroutine_handle::_S_fr{};

  inline noop_coroutine_handle noop_coroutine() noexcept
  {
    return noop_coroutine_handle();
  }

  // 17.12.5 Trivial awaitables
  /// [coroutine.trivial.awaitables]
  struct suspend_always
  {
    constexpr bool await_ready() const noexcept { return false; }

    constexpr void await_suspend(coroutine_handle<>) const noexcept {}

    constexpr void await_resume() const noexcept {}
  };

  struct suspend_never
  {
    constexpr bool await_ready() const noexcept { return true; }

    constexpr void await_suspend(coroutine_handle<>) const noexcept {}

    constexpr void await_resume() const noexcept {}
  };

  } // namespace __n4861

  template<typename _Tp> struct hash;

  template<typename _Promise>
    struct hash<coroutine_handle<_Promise>>
    {
      size_t
      operator()(const coroutine_handle<_Promise>& __h) const noexcept
      {
	return reinterpret_cast<size_t>(__h.address());
      }
    };

  _GLIBCXX_END_NAMESPACE_VERSION
} // namespace std

#endif // __cpp_lib_coroutine

#endif // _GLIBCXX_COROUTINE

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`