@@ -64,37 +64,11 @@ namespace STDEXEC
6464 using __on_not_callable =
6565 __mbind_front_q<__callable_error_t , decltype (__let_from_set<_SetTag>)>;
6666
67- // This environment is part of the receiver used to connect the secondary sender.
68- template <class _SetTag , class _Attrs , class ... _Env>
69- constexpr auto __mk_env2 (_Attrs const & __attrs, _Env const &... __env) noexcept
70- {
71- if constexpr (__callable<get_completion_scheduler_t <_SetTag>,
72- _Attrs const &,
73- __fwd_env_t <_Env const &>...>)
74- {
75- return __mk_sch_env (get_completion_scheduler<_SetTag>(__attrs, __fwd_env (__env)...),
76- __fwd_env (__env)...);
77- }
78- else if constexpr (__callable<get_completion_domain_t <_SetTag>,
79- _Attrs const &,
80- __fwd_env_t <_Env const &>...>)
81- {
82- using __domain_t = __call_result_t <get_completion_domain_t <_SetTag>,
83- _Attrs const &,
84- __fwd_env_t <_Env const &>...>;
85- return prop{get_domain, __domain_t {}};
86- }
87- else
88- {
89- return env{};
90- }
91- }
67+ template <class _SetTag , class _Sender , class ... _Env>
68+ using __env2_t = __call_result_t <__mk_secondary_env_t <_SetTag>, _Sender, _Env const &...>;
9269
93- template <class _SetTag , class _Attrs , class ... _Env>
94- using __env2_t = decltype (__let::__mk_env2<_SetTag>(__declval<_Attrs>(), __declval<_Env>()...));
95-
96- template <class _SetTag , class _Attrs , class _Env >
97- using __result_env_t = __join_env_t <__env2_t <_SetTag, _Attrs, _Env>, _Env>;
70+ template <class _SetTag , class _Sender , class _Env >
71+ using __result_env_t = __join_env_t <__env2_t <_SetTag, _Sender, _Env>, _Env>;
9872
9973 template <class _Receiver , class _Env2 >
10074 struct __rcvr_env
@@ -209,10 +183,9 @@ namespace STDEXEC
209183 using __completions_t = __gather_completion_signatures_t <
210184 __completion_signatures_of_t <_CvSender, _Env...>,
211185 __t <_LetTag>,
212- __transform_signal_fn<
213- __t <_LetTag>,
214- _Fun,
215- __result_env_t <__t <_LetTag>, env_of_t <_CvSender>, _Env>...>::template __f,
186+ __transform_signal_fn<__t <_LetTag>,
187+ _Fun,
188+ __result_env_t <__t <_LetTag>, _CvSender, _Env>...>::template __f,
216189 __cmplsigs::__default_completion,
217190 __mtry_q<__concat_completion_signatures_t >::__f>;
218191
@@ -243,7 +216,7 @@ namespace STDEXEC
243216 using __result_domain_t = __gather_completions_t <
244217 _SetTag,
245218 __completion_signatures_of_t <_Child, _Env>,
246- __result_sender_fn<_SetTag, _Fun, __result_env_t <_SetTag, env_of_t < _Child> , _Env>>,
219+ __result_sender_fn<_SetTag, _Fun, __result_env_t <_SetTag, _Child, _Env>>,
247220 __try_common_domain_fn<_SetTag, _Env>>;
248221
249222 // ! Metafunction creating the operation state needed to connect the result of calling
@@ -278,7 +251,7 @@ namespace STDEXEC
278251 using __has_nothrow_completions_t = __gather_completions_t <
279252 completion_signatures_of_t <_Child, _Env>,
280253 _SetTag,
281- __has_nothrow_completions_fn<_Fn, __result_env_t <_SetTag, env_of_t < _Child> , _Env>>,
254+ __has_nothrow_completions_fn<_Fn, __result_env_t <_SetTag, _Child, _Env>>,
282255 __qq<__mand_t >>;
283256
284257 // ! The core of the operation state for `let_*`.
@@ -289,15 +262,15 @@ namespace STDEXEC
289262 using __env2_t = _Env2;
290263 using __second_rcvr_t = __rcvr_env<_Receiver, _Env2>;
291264
292- template <class _Attrs >
265+ template <class _Sender >
293266 constexpr explicit __opstate_base (_SetTag,
294- _Attrs const & __attrs ,
295- _Fun __fn,
296- _Receiver&& __rcvr) noexcept
267+ _Sender const & __sndr ,
268+ _Fun __fn,
269+ _Receiver&& __rcvr) noexcept
297270 : __rcvr_(static_cast <_Receiver&&>(__rcvr))
298271 , __fn_(STDEXEC::__allocator_aware_forward(static_cast <_Fun&&>(__fn), __rcvr_))
299272 // TODO(ericniebler): this needs a fallback:
300- , __env2_(__let::__mk_env2 <_SetTag>(__attrs , STDEXEC::get_env(__rcvr_)))
273+ , __env2_(__mk_secondary_env_t <_SetTag>()(__sndr , STDEXEC::get_env(__rcvr_)))
301274 {}
302275
303276 constexpr virtual void __start_next () = 0;
@@ -400,7 +373,7 @@ namespace STDEXEC
400373 : __opstate_base<_SetTag,
401374 _Fun,
402375 _Receiver,
403- __let::__env2_t <_SetTag, env_of_t < _Child> , env_of_t <_Receiver>>,
376+ __let::__env2_t <_SetTag, _Child, env_of_t <_Receiver>>,
404377 _Tuples...>
405378 {
406379 using __env2_t = __opstate::__opstate_base::__env2_t ;
@@ -415,7 +388,7 @@ namespace STDEXEC
415388 noexcept (__nothrow_connectable<_Child, __first_rcvr_t >
416389 && __nothrow_move_constructible<_Fun>)
417390 : __opstate::__opstate_base(_SetTag(),
418- STDEXEC::get_env( __child) ,
391+ __child,
419392 static_cast<_Fun&&>(__fn),
420393 static_cast<_Receiver&&>(__rcvr))
421394 {
@@ -512,16 +485,16 @@ namespace STDEXEC
512485 using __f = decltype (__impl<_Ts...>());
513486 };
514487
515- template <class _SetTag , class _Fn , class _Attrs , class ... _Env>
488+ template <class _SetTag , class _Fn , class _Sender , class ... _Env>
516489 struct __domain_transform_fn
517490 {
518491 using __result_sender_fn =
519- __let::__result_sender_fn<_SetTag, _Fn, __result_env_t <_SetTag, _Attrs , _Env>...>;
492+ __let::__result_sender_fn<_SetTag, _Fn, __result_env_t <_SetTag, _Sender , _Env>...>;
520493
521494 template <class ... _As>
522495 using __f = __completion_domain_of_t <_SetTag,
523496 __mcall<__result_sender_fn, _As...>,
524- __result_env_t <_SetTag, _Attrs , _Env>...>;
497+ __result_env_t <_SetTag, _Sender , _Env>...>;
525498 };
526499
527500 // ! @tparam _LetTag The tag type for the let_ operation.
@@ -534,8 +507,7 @@ namespace STDEXEC
534507 {
535508 if constexpr (sender_in<_Sndr, _Env...>)
536509 {
537- using __domain_transform_fn =
538- __let::__domain_transform_fn<_SetTag, _Fn, env_of_t <_Sndr>, _Env...>;
510+ using __domain_transform_fn = __let::__domain_transform_fn<_SetTag, _Fn, _Sndr, _Env...>;
539511 return __minvoke_or_q<__gather_completions_t ,
540512 indeterminate_domain<>,
541513 __t <_LetTag>,
@@ -606,7 +578,7 @@ namespace STDEXEC
606578 using __transform_fn =
607579 __result_completion_behavior_fn<__set_tag_t ,
608580 _Fn,
609- __result_env_t <__set_tag_t , env_of_t < _Sndr> , _Env>...>;
581+ __result_env_t <__set_tag_t , _Sndr, _Env>...>;
610582 using __completions_t = __completion_signatures_of_t <_Sndr, __fwd_env_t <_Env>...>;
611583
612584 constexpr auto __pred_behavior =
0 commit comments