@@ -20,13 +20,17 @@ import beman.execution.detail.completion_signatures;
2020import beman.execution.detail.completion_signatures_for;
2121import beman.execution.detail.decayed_tuple;
2222import beman.execution.detail.default_impls;
23+ import beman.execution.detail.dependent_sender;
24+ import beman.execution.detail.dependent_sender_error;
25+ import beman.execution.detail.env;
2326import beman.execution.detail.env_of_t ;
2427import beman.execution.detail.error_types_of_t ;
2528import beman.execution.detail.get_domain_early;
2629import beman.execution.detail.impls_for;
2730import beman.execution.detail.make_sender;
2831import beman.execution.detail.meta.combine;
2932import beman.execution.detail.sender;
33+ import beman.execution.detail.sender_adaptor_closure;
3034import beman.execution.detail.sends_stopped;
3135import beman.execution.detail.set_error;
3236import beman.execution.detail.set_stopped;
@@ -39,13 +43,17 @@ import beman.execution.detail.variant_or_empty;
3943#include < beman/execution/detail/completion_signatures_for.hpp>
4044#include < beman/execution/detail/decayed_tuple.hpp>
4145#include < beman/execution/detail/default_impls.hpp>
46+ #include < beman/execution/detail/dependent_sender.hpp>
47+ #include < beman/execution/detail/dependent_sender_error.hpp>
48+ #include < beman/execution/detail/env.hpp>
4249#include < beman/execution/detail/env_of_t.hpp>
4350#include < beman/execution/detail/error_types_of_t.hpp>
4451#include < beman/execution/detail/get_domain_early.hpp>
4552#include < beman/execution/detail/impls_for.hpp>
4653#include < beman/execution/detail/make_sender.hpp>
4754#include < beman/execution/detail/meta_combine.hpp>
4855#include < beman/execution/detail/sender.hpp>
56+ #include < beman/execution/detail/sender_adaptor_closure.hpp>
4957#include < beman/execution/detail/sends_stopped.hpp>
5058#include < beman/execution/detail/set_error.hpp>
5159#include < beman/execution/detail/set_value.hpp>
@@ -56,25 +64,25 @@ import beman.execution.detail.variant_or_empty;
5664// ----------------------------------------------------------------------------
5765
5866namespace beman ::execution::detail {
59- struct into_variant_t {
67+ struct into_variant_t : ::beman::execution::sender_adaptor_closure< into_variant_t > {
6068 template <::beman::execution::sender Sender>
6169 auto operator ()(Sender&& sender) const {
62- // auto domain{::beman::execution::detail::get_domain_early(sender)};
63- // (void)domain;
64- return ::beman::execution::detail::make_sender (*this , {}, ::std::forward<Sender>(sender));
65- // return ::beman::execution::transform_sender(
66- // ::std::move(domain),
67- // ::beman::execution::detail::make_sender(*this, {}, ::std::forward<Sender>(sender))
68- // );
70+ return ::beman::execution::transform_sender (
71+ ::beman::execution::detail::get_domain_early (sender),
72+ ::beman::execution::detail::make_sender(*this , {}, ::std::forward<Sender>(sender)));
6973 }
7074
75+ auto operator ()() const noexcept { return ::beman::execution::detail::make_sender_adaptor (*this ); }
76+
7177 private:
7278 template <typename ... E>
7379 using make_error_types = ::beman::execution::completion_signatures<::beman::execution::set_error_t (E)...>;
7480
7581 private:
76- template <typename , typename >
82+ template <typename , typename ... >
7783 struct get_signatures ;
84+ template <typename Sender>
85+ struct get_signatures <Sender> : get_signatures<Sender, ::beman::execution::env<>> {};
7886 template <::beman::execution::sender Child, typename State, typename Env>
7987 struct get_signatures <
8088 ::beman::execution::detail::basic_sender<::beman::execution::detail::into_variant_t , State, Child>,
@@ -99,9 +107,9 @@ struct into_variant_t {
99107 };
100108
101109 public:
102- template <::beman::execution::sender Sender, typename Env>
110+ template <::beman::execution::sender Sender, typename ... Env>
103111 static consteval auto get_completion_signatures () {
104- return get_signatures<::std::remove_cvref_t <Sender>, Env>::get ();
112+ return get_signatures<::std::remove_cvref_t <Sender>, Env... >::get ();
105113 }
106114 struct impls_for : ::beman::execution::detail::default_impls {
107115 struct get_state_impl {
@@ -119,14 +127,14 @@ struct into_variant_t {
119127 if constexpr (::std::same_as<Tag, ::beman::execution::set_value_t >) {
120128 using variant_type = typename State::type;
121129 using tuple_type = ::beman::execution::detail::decayed_tuple<Args...>;
122- try {
123- if constexpr (sizeof ...(Args) == 0u )
124- ::beman::execution::set_value (::std::move(receiver));
125- else
130+ if constexpr (std::same_as<variant_type, ::beman::execution::detail::empty_variant>) {
131+ static_assert (sizeof ...(Args) == 0 );
132+ BEMAN_EXECUTION_TRY_EVAL (receiver, ::beman::execution::set_value (std::move (receiver)));
133+ } else {
134+ BEMAN_EXECUTION_TRY_EVAL (
135+ receiver,
126136 ::beman::execution::set_value (::std::move(receiver),
127- variant_type(tuple_type{::std::forward<Args>(args)...}));
128- } catch (...) {
129- ::beman::execution::set_error (::std::move(receiver), ::std::current_exception());
137+ variant_type(tuple_type{::std::forward<Args>(args)...})));
130138 }
131139 } else {
132140 Tag ()(::std::move (receiver), ::std::forward<Args>(args)...);
0 commit comments