diff --git a/include/stdexec/__detail/__spawn_future.hpp b/include/stdexec/__detail/__spawn_future.hpp index fd740061d..336ac744d 100644 --- a/include/stdexec/__detail/__spawn_future.hpp +++ b/include/stdexec/__detail/__spawn_future.hpp @@ -230,7 +230,7 @@ namespace STDEXEC using __op_t = connect_result_t<__future_spawned_sender<_Sender, _Env>, __receiver_t>; - using __base = __spawn_future_state_base>; + using __base = typename __spawn_future_state::__spawn_future_state_base; __spawn_future_state(_Alloc __alloc, _Sender&& __sndr, _Token __token, _Env __env) : __base(__do_try_cancel, __do_complete) diff --git a/include/stdexec/__detail/__stop_when.hpp b/include/stdexec/__detail/__stop_when.hpp index f4be5d282..f62c141f3 100644 --- a/include/stdexec/__detail/__stop_when.hpp +++ b/include/stdexec/__detail/__stop_when.hpp @@ -79,13 +79,6 @@ namespace STDEXEC struct __stop_when_impl : __sexpr_defaults { - template - static consteval auto __get_completion_signatures() - { - static_assert(__sender_for<_Sender, __stop_when_t>); - return get_completion_signatures<__child_of<_Sender>, _Env...>(); - }; - static constexpr auto __get_env = [](__ignore, auto const & __state) noexcept { return __env::__join(prop(get_stop_token, __state.__token_), @@ -199,6 +192,34 @@ namespace STDEXEC get_stop_token(STDEXEC::get_env(__rcvr))); return __state{std::move(__new_token), std::move(__rcvr)}; }; + + template + static consteval auto __get_completion_signatures() + { + static_assert(__sender_for<_Sender, __stop_when_t>); + + auto __sender_token = [](_Sender&& s) + { + auto& [__tag, __token, __child] = s; + return __token; + }; + + auto __new_token = [&](_Sender&& s, auto&& e) + { + return __make_token_fn{}(__sender_token(std::forward<_Sender>(s)), get_stop_token(e)); + }; + + auto __child_env = [&](_Sender&& s, Env&& e) + { + return __env::__join(prop(get_stop_token, + __new_token(std::forward<_Sender>(s), std::forward(e))), + std::forward(e)); + }; + + return get_completion_signatures<__child_of<_Sender>, + decltype(__child_env(std::declval<_Sender>(), + std::declval<_Env>()))...>(); + }; }; } // namespace __stop_when_