Skip to content

Commit

Permalink
clean up transfer_just.transform_sender
Browse files Browse the repository at this point in the history
  • Loading branch information
ericniebler committed Oct 20, 2023
1 parent a6cf9e1 commit 584eec6
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions include/stdexec/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5562,6 +5562,26 @@ namespace stdexec {
};
}

template <class _Env>
auto __make_transform_fn(const _Env& __env) {
return [&]<class _Scheduler, class... _Values>(_Scheduler&& __sched, _Values&&... __vals) {
auto __domain = __get_env_domain(__env);
return stdexec::transform_sender(
__domain,
transfer(
stdexec::transform_sender(__domain, just((_Values&&) __vals...), __env),
(_Scheduler&&) __sched),
__env);
};
}

template <class _Env>
auto __transform_sender_fn(const _Env& __env) {
return [&](__ignore, const auto& __data) {
return __apply(__make_transform_fn(__env), __data);
};
}

struct transfer_just_t {
using _Data = __0;
using __legacy_customizations_t = //
Expand All @@ -5583,17 +5603,7 @@ namespace stdexec {

template <class _Sender, class _Env>
static auto transform_sender(_Sender&& __sndr, const _Env& __env) {
return __apply(
[&]<class _Scheduler, class... _Values>(_Scheduler&& __sched, _Values&&... __vals) {
auto __domain = __get_env_domain(__env);
return stdexec::transform_sender(
__domain,
transfer(
stdexec::transform_sender(__domain, just((_Values&&) __vals...), __env),
(_Scheduler&&) __sched),
__env);
},
apply_sender((_Sender&&) __sndr, __detail::__get_data()));
return apply_sender((_Sender&&) __sndr, __transform_sender_fn(__env));
}
};
} // namespace __transfer_just
Expand Down

0 comments on commit 584eec6

Please sign in to comment.