/usr/include/c++/11
NameSizeModeActions
backward/-0755rm
bits/-0755rm
debug/-0755rm
decimal/-0755rm
experimental/-0755rm
ext/-0755rm
parallel/-0755rm
pstl/-0755rm
tr1/-0755rm
tr2/-0755rm
algorithm30450644editdlrm
any187580644editdlrm
array138200644editdlrm
atomic488000644editdlrm
barrier80260644editdlrm
bit121870644editdlrm
bitset459950644editdlrm
cassert16480644editdlrm
ccomplex13350644editdlrm
cctype24090644editdlrm
cerrno17700644editdlrm
cfenv20510644editdlrm
cfloat18890644editdlrm
charconv197610644editdlrm
chrono972120644editdlrm
cinttypes21570644editdlrm
ciso64614640644editdlrm
climits19130644editdlrm
clocale19050644editdlrm
cmath493820644editdlrm
codecvt52750644editdlrm
compare282710644editdlrm
complex567030644editdlrm
complex.h15960644editdlrm
concepts122300644editdlrm
condition_variable127800644editdlrm
coroutine91560644editdlrm
csetjmp19490644editdlrm
csignal18550644editdlrm
cstdalign14070644editdlrm
cstdarg18680644editdlrm
cstdbool14010644editdlrm
cstddef66900644editdlrm
cstdint23350644editdlrm
cstdio44390644editdlrm
cstdlib63250644editdlrm
cstring31560644editdlrm
ctgmath13600644editdlrm
ctime22980644editdlrm
cuchar22100644editdlrm
cwchar65420644editdlrm
cwctype27930644editdlrm
cxxabi.h222800644editdlrm
deque39730644editdlrm
exception50170644editdlrm
execution18030644editdlrm
fenv.h20200644editdlrm
filesystem16450644editdlrm
forward_list26900644editdlrm
fstream406800644editdlrm
functional402000644editdlrm
future522780644editdlrm
initializer_list30380644editdlrm
iomanip165470644editdlrm
ios16010644editdlrm
iosfwd75130644editdlrm
iostream26970644editdlrm
istream340980644editdlrm
iterator27510644editdlrm
latch27320644editdlrm
limits716740644editdlrm
list36570644editdlrm
locale14880644editdlrm
map39290644editdlrm
math.h45730644editdlrm
memory45130644editdlrm
memory_resource211130644editdlrm
mutex242230644editdlrm
new83490644editdlrm
numbers62440644editdlrm
numeric261100644editdlrm
optional401700644editdlrm
ostream259760644editdlrm
queue24670644editdlrm
random16920644editdlrm
ranges1072010644editdlrm
ratio201080644editdlrm
regex28610644editdlrm
scoped_allocator176490644editdlrm
semaphore30000644editdlrm
set37990644editdlrm
shared_mutex245880644editdlrm
source_location27470644editdlrm
span131310644editdlrm
sstream392310644editdlrm
stack23910644editdlrm
stdexcept98780644editdlrm
stdlib.h22480644editdlrm
stop_token159820644editdlrm
streambuf298900644editdlrm
string46450644editdlrm
string_view261570644editdlrm
syncstream83300644editdlrm
system_error150060644editdlrm
tgmath.h13600644editdlrm
thread59190644editdlrm
tuple627670644editdlrm
typeindex35120644editdlrm
typeinfo77460644editdlrm
type_traits1076670644editdlrm
unordered_map34670644editdlrm
unordered_set33400644editdlrm
utility148160644editdlrm
valarray406950644editdlrm
variant628660644editdlrm
vector42750644editdlrm
version92640644editdlrm
Edit: /usr/include/c++/11/coroutine (9156B)
// -*- C++ -*- // Copyright (C) 2019-2021 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 // . /** @file include/coroutine * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_COROUTINE #define _GLIBCXX_COROUTINE 1 #pragma GCC system_header // It is very likely that earlier versions would work, but they are untested. #if __cplusplus >= 201402L #include /** * @defgroup coroutines Coroutines * * Components for supporting coroutine implementations. */ #if __cplusplus > 201703L && __cpp_impl_three_way_comparison >= 201907L # include # define _COROUTINES_USE_SPACESHIP 1 #else # include // for std::less # define _COROUTINES_USE_SPACESHIP 0 #endif namespace std _GLIBCXX_VISIBILITY (default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cpp_impl_coroutine #define __cpp_lib_coroutine 201902L inline namespace __n4861 { // 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 struct __coroutine_traits_impl {}; template struct __coroutine_traits_impl<_Result, __void_t> { using promise_type = typename _Result::promise_type; }; template struct coroutine_traits : __coroutine_traits_impl<_Result> {}; // 17.12.3 Class template coroutine_handle /// [coroutine.handle] template struct coroutine_handle; template <> struct coroutine_handle { public: // [coroutine.handle.con], construct/reset constexpr coroutine_handle() noexcept : _M_fr_ptr(0) {} 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(); } #if _COROUTINES_USE_SPACESHIP 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()(__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 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 { // _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; 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 #else #error "the coroutine header requires -fcoroutines" #endif _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // C++14 (we are allowing use from at least this) #endif // _GLIBCXX_COROUTINE