transform_completion_signatures is an alias template
used to transform one set of completion signatures into another.
It takes a set of completion signatures and
several other template arguments
that apply modifications to each completion signature in the set
to generate a new specialization of completion_signatures.
Given a sender Sndr and an environment Env,
adapt the completion signatures of Sndr by
lvalue-ref qualifying the values,
adding an additional exception_ptr error completion
if its not already there, and
leaving the other completion signatures alone.
template<class... Args>using my_set_value_t =
completion_signatures<
set_value_t(add_lvalue_reference_t<Args>...)>;
using my_completion_signatures =
transform_completion_signatures<
completion_signatures_of_t<Sndr, Env>,
completion_signatures<set_error_t(exception_ptr)>,
my_set_value_t>;
— end example]
This subclause makes use of the following exposition-only entities:
template<class... As>usingdefault-set-value=
completion_signatures<set_value_t(As...)>;
template<class Err>usingdefault-set-error=
completion_signatures<set_error_t(Err)>;
SetValue shall name an alias template
such that for any pack of types As,
the type SetValue<As...> is either ill-formed or else
valid-completion-signatures<SetValue<As...>> is satisfied.
SetError shall name an alias template
such that for any type Err,
SetError<Err> is either ill-formed or else
valid-completion-signatures<SetError<Err>> is satisfied.
Let Es be a pack of the types in the type-list named by
gather-signatures<set_error_t, InputSignatures, type_identity_t, error-list>,
where error-list is an alias template
such that error-list< Ts...> is
type-list<SetError<Ts>...>.
Let Ss name the type completion_signatures<> if
gather-signatures<set_stopped_t, InputSignatures, type-list, type-list>
is an alias for the type type-list<>;
otherwise, SetStopped.
If any of the above types are ill-formed,
then
transform_completion_signatures<InputSignatures, AdditionalSignatures,
SetValue, SetError, SetStopped>
is ill-formed.
Otherwise,
transform_completion_signatures<InputSignatures, AdditionalSignatures,
SetValue, SetError, SetStopped>
is the type completion_signatures<Sigs...>
where Sigs... is the unique set of types in all the template arguments
of all the completion_signatures specializations in the set
AdditionalSignatures, Vs..., Es..., Ss.