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
52 changes: 0 additions & 52 deletions include/stdexec/__detail/__affine_on.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,53 +118,6 @@ namespace STDEXEC {
return completion_behavior::asynchronous_affine;
}
};

template <class _Self, class _Env>
consteval auto __get_completion_signatures() {
STDEXEC_COMPLSIGS_LET(
__child_completions, get_completion_signatures<__child_of<_Self>, __fwd_env_t<_Env>>()) {
using __child_completions_t = decltype(__child_completions);
using __sched_t = __call_result_or_t<get_scheduler_t, __not_a_scheduler<>, const _Env&>;
using __eptr_completion_t =
__eptr_completion_unless_t<__nothrow_decay_copyable_results_t<__child_completions_t>>;

constexpr auto __completions = __transform_completion_signatures(
__child_completions,
__decay_arguments<set_value_t, affine_on_t>(),
__decay_arguments<set_error_t, affine_on_t>(),
{},
__eptr_completion_t{});

if constexpr (!__decay_copyable_results_t<__child_completions_t>::value) {
// If the child sender's completion signatures aren't decay-copyable, then we can't
// adapt it to be affine.
return __throw_compile_time_error<
_WHAT_(_CANNOT_MAKE_SENDER_AFFINE_TO_THE_CURRENT_SCHEDULER_),
_WHY_(_SENDER_RESULTS_ARE_NOT_DECAY_COPYABLE_),
_WITH_PRETTY_SENDER_<__child_of<_Self>>,
_WITH_ENVIRONMENT_(_Env),
_WHERE_(_IN_ALGORITHM_, affine_on_t)
>();
} else if constexpr (__is_affine<__child_of<_Self>, _Env>) { // NOLINT(bugprone-branch-clone)
return __completions;
} else if constexpr (__same_as<__sched_t, __not_a_scheduler<>>) {
return __throw_compile_time_error<
_WHAT_(_CANNOT_MAKE_SENDER_AFFINE_TO_THE_CURRENT_SCHEDULER_),
_WHY_(_THE_CURRENT_EXECUTION_ENVIRONMENT_DOESNT_HAVE_A_SCHEDULER_),
_WHERE_(_IN_ALGORITHM_, affine_on_t)
>();
} else if constexpr (!__infallible_scheduler<__sched_t, _Env>) {
return __throw_compile_time_error<
_WHAT_(_CANNOT_MAKE_SENDER_AFFINE_TO_THE_CURRENT_SCHEDULER_),
_WHY_(_THE_SCHEDULER_IN_THE_CURRENT_EXECUTION_ENVIRONMENT_IS_NOT_INFALLIBLE_),
_WHERE_(_IN_ALGORITHM_, affine_on_t),
_WITH_SCHEDULER_(__sched_t)
>();
} else {
return __completions;
}
}
}
} // namespace __affine_on

template <>
Expand All @@ -173,10 +126,5 @@ namespace STDEXEC {
[](__ignore, __ignore, __ignore) noexcept {
return __affine_on::__attrs{};
};

template <class _Self, class _Env>
static consteval auto __get_completion_signatures() {
return __affine_on::__get_completion_signatures<_Self, _Env>();
}
};
} // namespace STDEXEC
2 changes: 1 addition & 1 deletion include/stdexec/__detail/__basic_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ namespace STDEXEC {
_Set()(static_cast<_State&&>(__state).__rcvr_, static_cast<_As&&>(__as)...);
};

template <class _Sender, class... _Env>
template <class _Sender, class _Env>
static consteval auto __get_completion_signatures() {
static_assert(
__mnever<tag_of_t<_Sender>>,
Expand Down
24 changes: 12 additions & 12 deletions include/stdexec/__detail/__when_all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ namespace STDEXEC {
};

static constexpr auto __start = []<class _State, class... _Operations>(
_State& __state,
_Operations&... __child_ops) noexcept -> void {
_State& __state,
_Operations&... __child_ops) noexcept -> void {
// register stop callback:
__state.__on_stop_.emplace(
get_stop_token(STDEXEC::get_env(__state.__rcvr_)),
Expand Down Expand Up @@ -473,10 +473,10 @@ namespace STDEXEC {
}

static constexpr auto __complete = []<class _Index, class _State, class _Set, class... _Args>(
_Index,
_State& __state,
_Set,
_Args&&... __args) noexcept -> void {
_Index,
_State& __state,
_Set,
_Args&&... __args) noexcept -> void {
using _ValuesTuple = decltype(_State::__values_);
if constexpr (__same_as<_Set, set_error_t>) {
__set_error(__state, static_cast<_Args&&>(__args)...);
Expand Down Expand Up @@ -534,9 +534,9 @@ namespace STDEXEC {

struct __transfer_when_all_impl : __sexpr_defaults {
static constexpr auto __get_attrs = []<class _Scheduler, class... _Child>(
__ignore,
const _Scheduler& __sched,
const _Child&...) noexcept {
__ignore,
const _Scheduler& __sched,
const _Child&...) noexcept {
// TODO(ericniebler): check this use of __sched_attrs
return __sched_attrs{std::cref(__sched)};
};
Expand All @@ -551,9 +551,9 @@ namespace STDEXEC {

struct __transfer_when_all_with_variant_impl : __sexpr_defaults {
static constexpr auto __get_attrs = []<class _Scheduler, class... _Child>(
__ignore,
const _Scheduler& __sched,
const _Child&...) noexcept {
__ignore,
const _Scheduler& __sched,
const _Child&...) noexcept {
return __sched_attrs{std::cref(__sched)};
};

Expand Down
Loading