Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/beman/execution/detail/continues_on.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ struct continues_on_t {
::beman::execution::detail::fwd_env(env)...);
}
auto query(::beman::execution::get_completion_scheduler_t<Tag>, const Env&... env) const noexcept {
return ::beman::execution::get_completion_scheduler<Tag>(this->sch, env...);
return ::beman::execution::get_completion_scheduler<Tag>(this->sch,
::beman::execution::detail::fwd_env(env)...);
}

template <typename Tag, typename... Env>
Expand Down
23 changes: 22 additions & 1 deletion include/beman/execution/detail/inline_scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,6 +28,9 @@ import beman.execution.detail.sender;
import beman.execution.detail.set_value;
#else
#include <beman/execution/detail/completion_signatures.hpp>
#include <beman/execution/detail/get_completion_domain.hpp>
#include <beman/execution/detail/get_completion_scheduler.hpp>
#include <beman/execution/detail/get_domain.hpp>
#include <beman/execution/detail/get_forward_progress_guarantee.hpp>
#include <beman/execution/detail/get_scheduler.hpp>
#include <beman/execution/detail/inline_attrs.hpp>
Expand All @@ -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 <typename Env>
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 <typename Env>
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;
Expand Down
9 changes: 7 additions & 2 deletions tests/beman/execution/exec-inline-scheduler.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<test_std::set_value_t>(attrs, test_env{});
auto sched = test_std::get_completion_scheduler<test_std::set_value_t>(attrs, test_env{});
auto sched1 = test_std::get_completion_scheduler<test_std::set_value_t>(test_std::inline_scheduler{}, test_env{});
static_assert(std::same_as<decltype(sched), custom_scheduler>);
static_assert(std::same_as<decltype(sched), decltype(sched1)>);
ASSERT(sched == custom_scheduler{7});
ASSERT(sched == sched1);
}

auto test_get_completion_domain_with_env() {
Expand All @@ -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<test_std::set_value_t>(attrs, test_env{});
auto dom = test_std::get_completion_domain<test_std::set_value_t>(attrs, test_env{});
auto dom1 = test_std::get_completion_domain<test_std::set_value_t>(test_std::inline_scheduler{}, test_env{});
static_assert(std::same_as<decltype(dom), custom_domain>);
static_assert(std::same_as<decltype(dom), decltype(dom1)>);
}

} // namespace
Expand Down
Loading