diff --git a/include/stdexec/__detail/__continues_on.hpp b/include/stdexec/__detail/__continues_on.hpp index 06ee3e7d2..5350bce53 100644 --- a/include/stdexec/__detail/__continues_on.hpp +++ b/include/stdexec/__detail/__continues_on.hpp @@ -56,7 +56,7 @@ namespace stdexec { } static auto __transform_sender_fn() { - return [&](__ignore, _Data&& __data, _Child&& __child) { + return [](__ignore, _Data&& __data, _Child&& __child) { return schedule_from(static_cast<_Data&&>(__data), static_cast<_Child&&>(__child)); }; } diff --git a/include/stdexec/__detail/__on.hpp b/include/stdexec/__detail/__on.hpp index 5255fe186..f91c3d101 100644 --- a/include/stdexec/__detail/__on.hpp +++ b/include/stdexec/__detail/__on.hpp @@ -172,12 +172,14 @@ namespace stdexec { } else { // This branch handles the case where `on` was called like `sndr | on(sch, clsur)` auto&& [__sched, __clsur] = static_cast<_Data&&>(__data); - return write_env( - continues_on( - __forward_like<_Data>(__clsur)(continues_on( - write_env(static_cast<_Child&&>(__child), __with_sched{__old}), __sched)), - __old), - __with_sched{__sched}); + return continues_on( + write_env( + __forward_like<_Data>(__clsur)( // + continues_on( + write_env(static_cast<_Child&&>(__child), __with_sched{__old}), // + __sched)), + __with_sched{__sched}), + __old); } }; }