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
7 changes: 3 additions & 4 deletions examples/algorithms/retry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ struct _retry_sender {
template <class... Ts>
using _value = stdexec::completion_signatures<stdexec::set_value_t(Ts...)>;

template <class Env>
auto get_completion_signatures(Env&&) const -> stdexec::transform_completion_signatures_of<
S&,
Env,
template <class Self, class... Env>
static consteval auto get_completion_signatures() -> stdexec::transform_completion_signatures<
stdexec::completion_signatures_of_t<S&, Env...>,
stdexec::completion_signatures<stdexec::set_error_t(std::exception_ptr)>,
_value,
_error
Expand Down
11 changes: 5 additions & 6 deletions examples/algorithms/then.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,15 @@ struct _then_sender {
using _set_value_t =
stdexec::completion_signatures<stdexec::set_value_t(std::invoke_result_t<F, Args...>)>;

template <class Env>
using _completions_t = stdexec::transform_completion_signatures_of<
S,
Env,
template <class... Env>
using _completions_t = stdexec::transform_completion_signatures<
stdexec::completion_signatures_of_t<S, Env...>,
stdexec::completion_signatures<stdexec::set_error_t(std::exception_ptr)>,
_set_value_t
>;

template <class Env>
auto get_completion_signatures(Env&&) && -> _completions_t<Env> {
template <class, class... Env>
static consteval auto get_completion_signatures() -> _completions_t<Env...> {
return {};
}

Expand Down
4 changes: 1 addition & 3 deletions examples/benchmark/static_thread_pool_old.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,9 @@ namespace exec_old {
STDEXEC_EXPLICIT_THIS_END(connect)

template <stdexec::__decays_to<bulk_sender> Self, class Env>
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this Self&&, Env&&)
-> completion_signatures<Self, Env> {
static consteval auto get_completion_signatures() -> completion_signatures<Self, Env> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

auto get_env() const noexcept -> stdexec::env_of_t<const Sender&> {
return stdexec::get_env(sndr_);
Expand Down
2 changes: 1 addition & 1 deletion include/exec/__detail/__basic_sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace exec {
};

template <class _Tag, class _Data, class... _Child>
STDEXEC_ATTRIBUTE(host, device)
STDEXEC_HOST_DEVICE_DEDUCTION_GUIDE
__seqexpr(_Tag, _Data, _Child...)
-> __seqexpr<STDEXEC_SEXPR_DESCRIPTOR(_Tag, _Data, _Child...)>;
} // namespace
Expand Down
4 changes: 1 addition & 3 deletions include/exec/any_sender_of.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,11 +1233,9 @@ namespace exec {

template <STDEXEC::__decays_to_derived_from<any_sender> _Self, class... _Env>
requires(__any::__satisfies_receiver_query<decltype(_ReceiverQueries), _Env...> && ...)
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _Env&&...) noexcept
-> __sender_base::completion_signatures {
static consteval auto get_completion_signatures() -> __sender_base::completion_signatures {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

template <STDEXEC::receiver_of<_Completions> _Receiver>
auto connect(_Receiver __rcvr) && -> STDEXEC::connect_result_t<__sender_base, _Receiver> {
Expand Down
10 changes: 3 additions & 7 deletions include/exec/async_scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@ namespace exec {
STDEXEC_EXPLICIT_THIS_END(connect)

template <__decays_to<__t> _Self, class... _Env>
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _Env&&...)
static consteval auto get_completion_signatures()
-> __completion_signatures_of_t<__copy_cvref_t<_Self, _Constrained>, __env_t<_Env>...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

const __impl* __scope_;
STDEXEC_ATTRIBUTE(no_unique_address) _Constrained __c_;
Expand Down Expand Up @@ -278,11 +277,10 @@ namespace exec {
STDEXEC_EXPLICIT_THIS_END(connect)

template <__decays_to<__t> _Self, class... _Env>
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _Env&&...)
static consteval auto get_completion_signatures()
-> __completion_signatures_of_t<__copy_cvref_t<_Self, _Constrained>, __env_t<_Env>...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)
};
};

Expand Down Expand Up @@ -684,11 +682,9 @@ namespace exec {
STDEXEC_EXPLICIT_THIS_END(connect)

template <__decays_to<__t> _Self, class... _OtherEnv>
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _OtherEnv&&...)
-> __completions_t<_Self> {
static consteval auto get_completion_signatures() -> __completions_t<_Self> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

private:
friend struct async_scope;
Expand Down
4 changes: 1 addition & 3 deletions include/exec/at_coroutine_exit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,9 @@ namespace exec {
}

template <__same_as<__t> _Self, class... _Env>
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _Env&&...)
-> __completions_t<_Env...> {
static consteval auto get_completion_signatures() -> __completions_t<_Env...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

auto get_env() const noexcept -> env_of_t<_Sender> {
return STDEXEC::get_env(__sender_);
Expand Down
15 changes: 13 additions & 2 deletions include/exec/completion_signatures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ namespace exec {
detail::normalize(static_cast<Sigs*>(nullptr))...));
} // namespace detail

///////////////////////////////////////////////////////////////////////////////////////////////////
// get_child_completion_signatures
template <STDEXEC::sender _Parent, STDEXEC::sender _Child, class... _Env>
[[nodiscard]]
consteval auto get_child_completion_signatures() {
return STDEXEC::get_completion_signatures<
STDEXEC::__copy_cvref_t<_Parent, _Child>,
STDEXEC::__fwd_env_t<_Env>...
>();
}

//! Creates a compile-time completion signatures type from explicit and deduced signature types.
//!
//! This function is a compile-time helper that constructs a completion signatures type
Expand Down Expand Up @@ -213,8 +224,8 @@ namespace exec {
ErrorFn error_fn = {},
StoppedFn stopped_fn = {},
ExtraSigs = {}) {
STDEXEC_COMPLSIGS_LET(auto(completions) = Completions{}) {
STDEXEC_COMPLSIGS_LET(auto(extra_sigs) = ExtraSigs{}) {
STDEXEC_COMPLSIGS_LET(completions, Completions{}) {
STDEXEC_COMPLSIGS_LET(extra_sigs, ExtraSigs{}) {
detail::_transform_one<ValueFn, ErrorFn, StoppedFn> tfx1{value_fn, error_fn, stopped_fn};
return concat_completion_signatures(
completions.__apply(detail::_transform_all_fn{tfx1}), extra_sigs);
Expand Down
8 changes: 3 additions & 5 deletions include/exec/env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ namespace exec {
}
STDEXEC_EXPLICIT_THIS_END(connect)

template <class _Env>
constexpr auto get_completion_signatures(_Env&&) -> __completions_t<_Env> {
template <class, class _Env>
static consteval auto get_completion_signatures() -> __completions_t<_Env> {
return {};
}
};
Expand Down Expand Up @@ -166,12 +166,10 @@ namespace exec {
}

template <__decays_to<__t> _Self, class... _Env>
constexpr STDEXEC_EXPLICIT_THIS_BEGIN(
auto get_completion_signatures)(this _Self&&, _Env&&...)
static consteval auto get_completion_signatures()
-> __completion_signatures_of_t<__copy_cvref_t<_Self, _Sender>, _Env...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

template <__decays_to<__t> _Self, class _Receiver>
requires sender_in<__copy_cvref_t<_Self, _Sender>, env_of_t<_Receiver>>
Expand Down
Loading
Loading