@@ -16,6 +16,7 @@ import std;
1616#include < type_traits>
1717#include < utility>
1818#include < variant>
19+ #include < iostream> // -dk:TODO remove
1920#endif
2021#ifdef BEMAN_HAS_MODULES
2122import beman.execution.detail.basic_sender;
@@ -47,6 +48,7 @@ import beman.execution.detail.meta.to;
4748import beman.execution.detail.meta.transform;
4849import beman.execution.detail.meta.unique;
4950import beman.execution.detail.on_stop_request;
51+ import beman.execution.detail.prop;
5052import beman.execution.detail.sender;
5153import beman.execution.detail.sender_in;
5254import beman.execution.detail.sends_stopped;
@@ -85,6 +87,7 @@ import beman.execution.detail.value_types_of_t;
8587#include < beman/execution/detail/meta_transform.hpp>
8688#include < beman/execution/detail/meta_unique.hpp>
8789#include < beman/execution/detail/on_stop_request.hpp>
90+ #include < beman/execution/detail/prop.hpp>
8891#include < beman/execution/detail/sender.hpp>
8992#include < beman/execution/detail/sender_in.hpp>
9093#include < beman/execution/detail/sends_stopped.hpp>
@@ -117,13 +120,20 @@ concept valid_when_all_sender = ::beman::execution::dependent_sender<Sender> ||
117120inline constexpr auto make_when_all_env = [](const ::beman::execution::inplace_stop_source& stop_src,
118121 const auto & env) noexcept {
119122 return ::beman::execution::detail::join_env (
120- ::beman::execution::detail::make_env (::beman::execution::get_stop_token, stop_src.get_token()), env);
123+ ::beman::execution::env{::beman::execution::prop{::beman::execution::get_stop_token, stop_src.get_token ()}},
124+ env);
121125};
122126
123127template <typename Env>
124128using when_all_env =
125129 decltype (make_when_all_env(::std::declval<::beman::execution::inplace_stop_source>(), ::std::declval<Env>()));
126130
131+ static_assert (std::same_as<::beman::execution::never_stop_token,
132+ decltype (::beman::execution::get_stop_token(::std::declval<::beman::execution::env<>>()))>);
133+ static_assert (std::same_as<::beman::execution::inplace_stop_token,
134+ decltype (::beman::execution::get_stop_token(
135+ ::std::declval<when_all_env<::beman::execution::env<>>>()))>);
136+
127137struct when_all_t {
128138 template <::beman::execution::sender... Sender>
129139 requires (0u != sizeof ...(Sender)) && (... && beman::execution::detail::valid_when_all_sender<Sender>) &&
@@ -188,6 +198,7 @@ struct when_all_t {
188198 struct get_env_impl {
189199 template <typename State, typename Receiver>
190200 auto operator ()(auto &&, State& state, const Receiver& receiver) const noexcept {
201+ std::cout << " when_all::get_env()\n " ;
191202 return make_when_all_env (state.stop_src , ::beman::execution::get_env (receiver));
192203 }
193204 };
@@ -202,7 +213,7 @@ struct when_all_t {
202213 template <typename Receiver, typename ... Sender>
203214 struct state_type {
204215 struct nonesuch {};
205- using env_t = ::beman::execution::env_of_t <Receiver>;
216+ using env_t = when_all_env< ::beman::execution::env_of_t <Receiver> >;
206217 using copy_fail = ::std::conditional_t <
207218 (... && ::beman::execution::value_types_of_t <Sender,
208219 env_t ,
@@ -291,7 +302,7 @@ struct when_all_t {
291302
292303 template <typename Receiver>
293304 struct make_state {
294- template <::beman::execution::sender_in<::beman::execution::env_of_t <Receiver>>... Sender>
305+ template <::beman::execution::sender_in<when_all_env< ::beman::execution::env_of_t <Receiver> >>... Sender>
295306 auto operator ()(auto , auto , Sender&&...) const {
296307 return state_type<Receiver, Sender...>{};
297308 }
0 commit comments