File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,15 @@ namespace exec {
132132 public:
133133 using promise_type = __promise;
134134
135+ #if STDEXEC_EDG()
136+ __task (__coro::coroutine_handle<__promise> __coro) noexcept
137+ : __coro_ (__coro) {
138+ }
139+ #else
135140 explicit __task (__coro::coroutine_handle<__promise> __coro) noexcept
136141 : __coro_ (__coro) {
137142 }
143+ #endif
138144
139145 __task (__task&& __that) noexcept
140146 : __coro_ (std::exchange (__that.__coro_ , {})) {
@@ -184,10 +190,17 @@ namespace exec {
184190 };
185191
186192 struct __promise : with_awaitable_senders<__promise> {
193+ #if STDEXEC_EDG()
194+ template <class _Action >
195+ __promise (_Action&&, _Ts&&... __ts) noexcept
196+ : __args_{__ts...} {
197+ }
198+ #else
187199 template <class _Action >
188200 explicit __promise (_Action&&, _Ts&... __ts) noexcept
189201 : __args_{__ts...} {
190202 }
203+ #endif
191204
192205 auto initial_suspend () noexcept -> __coro::suspend_always {
193206 return {};
Original file line number Diff line number Diff line change @@ -129,10 +129,17 @@ namespace exec {
129129 };
130130
131131 struct __promise : with_awaitable_senders<__promise> {
132+ #if STDEXEC_EDG()
133+ template <class _Action >
134+ __promise (_Action&&, _Ts&&... __ts) noexcept
135+ : __args_{__ts...} {
136+ }
137+ #else
132138 template <class _Action >
133139 explicit __promise (_Action&&, _Ts&... __ts) noexcept
134140 : __args_{__ts...} {
135141 }
142+ #endif
136143
137144 auto initial_suspend () noexcept -> __coro::suspend_always {
138145 return {};
@@ -189,6 +196,12 @@ namespace exec {
189196 private:
190197 template <class _Action , class ... _Ts>
191198 static auto __impl (_Action __action, _Ts... __ts) -> __task<_Ts...> {
199+ #if STDEXEC_EDG()
200+ // This works around an EDG bug where the compiler misinterprets __get_disposition:
201+ // operand to this co_await expression resolves to non-class "<unnamed>"
202+ using __get_disposition =
203+ std::enable_if_t <sizeof (_Action) != 0 , __on_coro_disp::__get_disposition>;
204+ #endif
192205 task_disposition __d = co_await __get_disposition ();
193206 if (__d == _OnCompletion) {
194207 co_await static_cast <_Action&&>(__action)(static_cast <_Ts&&>(__ts)...);
Original file line number Diff line number Diff line change @@ -104,9 +104,15 @@ namespace stdexec {
104104 struct __t : __promise_base {
105105 using __id = __promise;
106106
107+ #if STDEXEC_EDG()
108+ __t (auto &&, _Receiver&& __rcvr) noexcept
109+ : __rcvr_(__rcvr) {
110+ }
111+ #else
107112 explicit __t (auto &, _Receiver& __rcvr) noexcept
108113 : __rcvr_(__rcvr) {
109114 }
115+ #endif
110116
111117 auto unhandled_stopped () noexcept -> __coro::coroutine_handle<> {
112118 stdexec::set_stopped (static_cast <_Receiver&&>(__rcvr_));
You can’t perform that action at this time.
0 commit comments