/
usr
/
include
/
c++
/
11
/
/usr/include/c++/11
mkdir
upload
Name
Size
Mode
Actions
backward/
-
0755
rm
bits/
-
0755
rm
debug/
-
0755
rm
decimal/
-
0755
rm
experimental/
-
0755
rm
ext/
-
0755
rm
parallel/
-
0755
rm
pstl/
-
0755
rm
tr1/
-
0755
rm
tr2/
-
0755
rm
algorithm
3045
0644
edit
dl
rm
any
18758
0644
edit
dl
rm
array
13820
0644
edit
dl
rm
atomic
48800
0644
edit
dl
rm
barrier
8026
0644
edit
dl
rm
bit
12187
0644
edit
dl
rm
bitset
45995
0644
edit
dl
rm
cassert
1648
0644
edit
dl
rm
ccomplex
1335
0644
edit
dl
rm
cctype
2409
0644
edit
dl
rm
cerrno
1770
0644
edit
dl
rm
cfenv
2051
0644
edit
dl
rm
cfloat
1889
0644
edit
dl
rm
charconv
19761
0644
edit
dl
rm
chrono
97212
0644
edit
dl
rm
cinttypes
2157
0644
edit
dl
rm
ciso646
1464
0644
edit
dl
rm
climits
1913
0644
edit
dl
rm
clocale
1905
0644
edit
dl
rm
cmath
49382
0644
edit
dl
rm
codecvt
5275
0644
edit
dl
rm
compare
28271
0644
edit
dl
rm
complex
56703
0644
edit
dl
rm
complex.h
1596
0644
edit
dl
rm
concepts
12230
0644
edit
dl
rm
condition_variable
12780
0644
edit
dl
rm
coroutine
9156
0644
edit
dl
rm
csetjmp
1949
0644
edit
dl
rm
csignal
1855
0644
edit
dl
rm
cstdalign
1407
0644
edit
dl
rm
cstdarg
1868
0644
edit
dl
rm
cstdbool
1401
0644
edit
dl
rm
cstddef
6690
0644
edit
dl
rm
cstdint
2335
0644
edit
dl
rm
cstdio
4439
0644
edit
dl
rm
cstdlib
6325
0644
edit
dl
rm
cstring
3156
0644
edit
dl
rm
ctgmath
1360
0644
edit
dl
rm
ctime
2298
0644
edit
dl
rm
cuchar
2210
0644
edit
dl
rm
cwchar
6542
0644
edit
dl
rm
cwctype
2793
0644
edit
dl
rm
cxxabi.h
22280
0644
edit
dl
rm
deque
3973
0644
edit
dl
rm
exception
5017
0644
edit
dl
rm
execution
1803
0644
edit
dl
rm
fenv.h
2020
0644
edit
dl
rm
filesystem
1645
0644
edit
dl
rm
forward_list
2690
0644
edit
dl
rm
fstream
40680
0644
edit
dl
rm
functional
40200
0644
edit
dl
rm
future
52278
0644
edit
dl
rm
initializer_list
3038
0644
edit
dl
rm
iomanip
16547
0644
edit
dl
rm
ios
1601
0644
edit
dl
rm
iosfwd
7513
0644
edit
dl
rm
iostream
2697
0644
edit
dl
rm
istream
34098
0644
edit
dl
rm
iterator
2751
0644
edit
dl
rm
latch
2732
0644
edit
dl
rm
limits
71674
0644
edit
dl
rm
list
3657
0644
edit
dl
rm
locale
1488
0644
edit
dl
rm
map
3929
0644
edit
dl
rm
math.h
4573
0644
edit
dl
rm
memory
4513
0644
edit
dl
rm
memory_resource
21113
0644
edit
dl
rm
mutex
24223
0644
edit
dl
rm
new
8349
0644
edit
dl
rm
numbers
6244
0644
edit
dl
rm
numeric
26110
0644
edit
dl
rm
optional
40170
0644
edit
dl
rm
ostream
25976
0644
edit
dl
rm
queue
2467
0644
edit
dl
rm
random
1692
0644
edit
dl
rm
ranges
107201
0644
edit
dl
rm
ratio
20108
0644
edit
dl
rm
regex
2861
0644
edit
dl
rm
scoped_allocator
17649
0644
edit
dl
rm
semaphore
3000
0644
edit
dl
rm
set
3799
0644
edit
dl
rm
shared_mutex
24588
0644
edit
dl
rm
source_location
2747
0644
edit
dl
rm
span
13131
0644
edit
dl
rm
sstream
39231
0644
edit
dl
rm
stack
2391
0644
edit
dl
rm
stdexcept
9878
0644
edit
dl
rm
stdlib.h
2248
0644
edit
dl
rm
stop_token
15982
0644
edit
dl
rm
streambuf
29890
0644
edit
dl
rm
string
4645
0644
edit
dl
rm
string_view
26157
0644
edit
dl
rm
syncstream
8330
0644
edit
dl
rm
system_error
15006
0644
edit
dl
rm
tgmath.h
1360
0644
edit
dl
rm
thread
5919
0644
edit
dl
rm
tuple
62767
0644
edit
dl
rm
typeindex
3512
0644
edit
dl
rm
typeinfo
7746
0644
edit
dl
rm
type_traits
107667
0644
edit
dl
rm
unordered_map
3467
0644
edit
dl
rm
unordered_set
3340
0644
edit
dl
rm
utility
14816
0644
edit
dl
rm
valarray
40695
0644
edit
dl
rm
variant
62866
0644
edit
dl
rm
vector
4275
0644
edit
dl
rm
version
9264
0644
edit
dl
rm
Edit:
/usr/include/c++/11/coroutine
(9156B)
// <coroutine> -*- 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 // <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 // It is very likely that earlier versions would work, but they are untested. #if __cplusplus >= 201402L #include <bits/c++config.h> /** * @defgroup coroutines Coroutines * * Components for supporting coroutine implementations. */ #if __cplusplus > 201703L && __cpp_impl_three_way_comparison >= 201907L # include <compare> # define _COROUTINES_USE_SPACESHIP 1 #else # include <bits/stl_function.h> // 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 <typename _Result, typename = void> struct __coroutine_traits_impl {}; template <typename _Result> struct __coroutine_traits_impl<_Result, __void_t<typename _Result::promise_type>> { using promise_type = typename _Result::promise_type; }; template <typename _Result, typename...> struct coroutine_traits : __coroutine_traits_impl<_Result> {}; // 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(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<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 #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
Save
cmd:
run