diff --git a/include/exec/repeat_n.hpp b/include/exec/repeat_n.hpp index 9c2c75904..58344d868 100644 --- a/include/exec/repeat_n.hpp +++ b/include/exec/repeat_n.hpp @@ -225,11 +225,19 @@ namespace experimental::execution return {STDEXEC::schedule(trampoline_scheduler{}), const_cast<_Child &>(__child)}; }; - template + template + requires(!STDEXEC::dependent_sender<__child_of<_Sender>>) static consteval auto __get_completion_signatures() { // TODO: port this to use constant evaluation - return __completions_t<__child_of<_Sender>, _Env...>{}; + return __completions_t<__child_of<_Sender>>{}; + } + + template + static consteval auto __get_completion_signatures() + { + // TODO: port this to use constant evaluation + return __completions_t<__child_of<_Sender>, _Env>{}; } static constexpr auto __connect = // diff --git a/test/exec/test_repeat_n.cpp b/test/exec/test_repeat_n.cpp index 03b8e4601..76862c971 100644 --- a/test/exec/test_repeat_n.cpp +++ b/test/exec/test_repeat_n.cpp @@ -199,4 +199,9 @@ namespace } } + TEST_CASE("repeat_n forwards the environment", "[adaptors][repeat_n]") + { + ex::sync_wait( + exec::repeat_n(ex::then(ex::read_env(ex::get_start_scheduler), [](auto) noexcept {}), 1)); + } } // namespace