Skip to content

__completion_signatures_of_t requires that get_completion_signatures<S,E...>() is a constant expression#1899

Open
ericniebler wants to merge 2 commits intoNVIDIA:mainfrom
ericniebler:safer-completion-signatures-of-t
Open

__completion_signatures_of_t requires that get_completion_signatures<S,E...>() is a constant expression#1899
ericniebler wants to merge 2 commits intoNVIDIA:mainfrom
ericniebler:safer-completion-signatures-of-t

Conversation

@ericniebler
Copy link
Collaborator

currently, the definition of the __completion_signatures_of_t alias is:

  using __completion_signatures_of_t =
    decltype(STDEXEC::get_completion_signatures<_Sender, _Env...>());

the trouble with this is that if get_completion_signatures exits with a compile-time exception, that error is lost, and we end up aliasing the declared return type of get_completion_signatures, aka completion_signatures<>.

a better definition looks like

  using __completion_signatures_of_t =
    __mtypeof<STDEXEC::get_completion_signatures<_Sender, _Env...>()>;

where __mtypeof is simply:

template <auto V>
using __mtypeof = decltype(V);

this causes __completion_signatures_of_t to SFINAE when the call to get_completion_signatures is not a constant expression.

@ericniebler ericniebler force-pushed the safer-completion-signatures-of-t branch from d5216a9 to 4a2f36b Compare February 28, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant