Open
Description
it is desirable to compute completion signatures with the type of the receiver instead of with the environment only, as is done in P2300R9. this makes it possible to know whether connect(sndr, rcvr)
can throw, which can effect the sender's completion signatures.
the easiest solution is to remove get_completion_signatures
and put the completion signatures in the operation state as a nested typedef. doing that involves the following:
- change the
operation_state
concept to require types to have a nested::completion_signatures
alias that denotes a specialization of thecompletion_signatures<>
class template.template<class O> concept operation_state = derived_from<typename O::operation_state_concept, operation_state_t> && valid-completion-signatures<typename O::completion_signatures> && requires (O& o) { { start(o) } noexcept; };
- remove the mandate that
connect
return an operation state. - add a
::completion_signatures
alias tooperation-state-task
- add a type
receiver_archetype
as follows:struct receiver_archetype { using receiver_concept = receiver_t; void set_value(auto&&...) noexcept; void set_error(auto&&) noexcept; void set_stopped() noexcept; empty_env get_env() const noexcept; };
- change
completion_signatures_of_t
to take a sender type and a receiver type. default the receiver parameter toreceiver_archetype
. Make similar changes tovalue_types_of_t
,error_types_of_t
andsends_stopped
. - remove the
sender_in
concept - change the
sender_to
concept as follows:template<class Sndr, class Rcvr> concept sender_to = sender<Sndr> && receiver_of<Rcvr, completion_signatures_of_t<Sndr, Rcvr>> && requires (Sndr&& sndr, Rcvr&& rcvr) { { connect(std::forward<Sndr>(sndr), std::forward<Rcvr>(rcvr)) } -> operation_state; };
- change
sender-of
andsender-of-in
as follows:template<class Sndr, class Rcvr, class... Values> concept sender-of-to = sender_to<Sndr, Rcvr> && MATCHING-SIG( // see [exec.general] set_value_t(Values...), value_types_of_t<Sndr, Rcvr, value-signature, type_identity_t>); template<class Sndr, class... Values> concept sender-of = sender-of-in<Sndr, receiver_archetype, Values...>;
- change all prose referring to the
sender_in
concept to instead usesender_to
with an appropriate receiver type. - figure out if
transform_sender
andtransform_env
need to change. - in the specification of
let_value
, changelet-bind
to conditionally handle an exception fromconnect
. - change
transform_completion_signatures
to propagate type errors. - probably more ...