diff --git a/include/beman/execution/detail/continues_on.hpp b/include/beman/execution/detail/continues_on.hpp index f9a461f6..30242eb4 100644 --- a/include/beman/execution/detail/continues_on.hpp +++ b/include/beman/execution/detail/continues_on.hpp @@ -136,7 +136,8 @@ struct continues_on_t { ::beman::execution::detail::fwd_env(env)...); } auto query(::beman::execution::get_completion_scheduler_t, const Env&... env) const noexcept { - return ::beman::execution::get_completion_scheduler(this->sch, env...); + return ::beman::execution::get_completion_scheduler(this->sch, + ::beman::execution::detail::fwd_env(env)...); } template diff --git a/include/beman/execution/detail/inline_scheduler.hpp b/include/beman/execution/detail/inline_scheduler.hpp index ec9b85c8..0e6129a5 100644 --- a/include/beman/execution/detail/inline_scheduler.hpp +++ b/include/beman/execution/detail/inline_scheduler.hpp @@ -15,6 +15,9 @@ import std; #ifdef BEMAN_HAS_MODULES import beman.execution.detail.completion_signatures; import beman.execution.detail.get_forward_progress_guarantee; +import beman.execution.detail.get_completion_domain; +import beman.execution.detail.get_completion_scheduler; +import beman.execution.detail.get_domain; import beman.execution.detail.get_scheduler; import beman.execution.detail.inline_attrs; import beman.execution.detail.operation_state; @@ -25,6 +28,9 @@ import beman.execution.detail.sender; import beman.execution.detail.set_value; #else #include +#include +#include +#include #include #include #include @@ -42,10 +48,25 @@ struct inline_scheduler { using env = ::beman::execution::detail::inline_attrs<::beman::execution::set_value_t>; - auto query(::beman::execution::get_forward_progress_guarantee_t) const noexcept + static auto query(::beman::execution::get_forward_progress_guarantee_t) noexcept -> ::beman::execution::forward_progress_guarantee { return ::beman::execution::forward_progress_guarantee::weakly_parallel; } + + template + requires requires(const Env& env) { ::beman::execution::get_scheduler(env); } + static auto query(const ::beman::execution::get_completion_scheduler_t<::beman::execution::set_value_t>&, + const Env& env) noexcept { + return ::beman::execution::get_scheduler(env); + } + + template + requires requires(const Env& env) { ::beman::execution::get_domain(env); } + static auto query(const ::beman::execution::get_completion_domain_t<::beman::execution::set_value_t>&, + const Env& env) noexcept { + return ::beman::execution::get_domain(env); + } + template <::beman::execution::receiver Rcvr> struct state { using operation_state_concept = ::beman::execution::operation_state_tag; diff --git a/tests/beman/execution/exec-inline-scheduler.test.cpp b/tests/beman/execution/exec-inline-scheduler.test.cpp index 73aa75bd..33289808 100644 --- a/tests/beman/execution/exec-inline-scheduler.test.cpp +++ b/tests/beman/execution/exec-inline-scheduler.test.cpp @@ -204,9 +204,12 @@ auto test_get_completion_scheduler_with_env() { auto query(test_std::get_scheduler_t) const noexcept { return custom_scheduler{7}; } }; - auto sched = test_std::get_completion_scheduler(attrs, test_env{}); + auto sched = test_std::get_completion_scheduler(attrs, test_env{}); + auto sched1 = test_std::get_completion_scheduler(test_std::inline_scheduler{}, test_env{}); static_assert(std::same_as); + static_assert(std::same_as); ASSERT(sched == custom_scheduler{7}); + ASSERT(sched == sched1); } auto test_get_completion_domain_with_env() { @@ -217,8 +220,10 @@ auto test_get_completion_domain_with_env() { auto query(test_std::get_domain_t) const noexcept { return custom_domain{}; } }; - auto dom = test_std::get_completion_domain(attrs, test_env{}); + auto dom = test_std::get_completion_domain(attrs, test_env{}); + auto dom1 = test_std::get_completion_domain(test_std::inline_scheduler{}, test_env{}); static_assert(std::same_as); + static_assert(std::same_as); } } // namespace