#
completion_signatures is a type that encodes a set of completion signatures ([exec.async.ops]).
2
#
[Example 1: struct my_sender { using sender_concept = sender_t; using completion_signatures = execution::completion_signatures< set_value_t(), set_value_t(int, float), set_error_t(exception_ptr), set_error_t(error_code), set_stopped_t()>; };
Declares my_sender to be a sender that can complete by calling one of the following for a receiver expression rcvr:
  • set_value(rcvr)
  • set_value(rcvr, int{.}, float{.})
  • set_error(rcvr, exception_ptr{.})
  • set_error(rcvr, error_code{.})
  • set_stopped(rcvr)
— end example]
This subclause makes use of the following exposition-only entities: template<class Fn> concept completion-signature = see below;
A type Fn satisfies completion-signature if and only if it is a function type with one of the following forms:
  • set_value_t(Vs..), where Vs is a pack of object or reference types.
  • set_error_t(Err), where Err is an object or reference type.
  • set_stopped_t()
template<bool> struct indirect-meta-apply { template<template<class.> class T, class. As> using meta-apply = T<As..>; / exposition only }; template<class.> concept always-true = true; / exposition only template<class Tag, valid-completion-signatures Completions, template<class.> class Tuple, template<class.> class Variant> using gather-signatures = see below;
Let Fns be a pack of the arguments of the completion_signatures specialization named by Completions, let TagFns be a pack of the function types in Fns whose return types are Tag, and let
Then, given two variadic templates Tuple and Variant, the type gather-signatures<Tag, Completions, Tuple, Variant> names the type META-APPLY(Variant, META-APPLY(Tuple, Ts
[Note 1: 
The purpose of META-APPLY is to make it valid to use non-variadic templates as Variant and Tuple arguments to gather-signatures.
— end note]
namespace std::execution { template<completion-signature.. Fns> struct completion_signatures { template<class Tag> static constexpr size_t count-of(Tag) { return see below; } template<class Fn> static constexpr void for-each(Fn&& fn) { / exposition only (fn(static_cast<Fns*>(nullptr), ..); } }; template<class Sndr, class Env = env<>, template<class.> class Tuple = decayed-tuple, template<class.> class Variant = variant-or-empty> requires sender_in<Sndr, Env> using value_types_of_t = gather-signatures<set_value_t, completion_signatures_of_t<Sndr, Env>, Tuple, Variant>; template<class Sndr, class Env = env<>, template<class.> class Variant = variant-or-empty> requires sender_in<Sndr, Env> using error_types_of_t = gather-signatures<set_error_t, completion_signatures_of_t<Sndr, Env>, type_identity_t, Variant>; template<class Sndr, class Env = env<> requires sender_in<Sndr, Env> constexpr bool sends_stopped = !same_as<type-list<>, gather-signatures<set_stopped_t, completion_signatures_of_t<Sndr, Env>, type-list, type-list>>; }
For a subexpression tag, let Tag be the decayed type of tag.
completion_signatures<Fns..>​::​count-of(
tag)
returns the count of function types in Fns.. that are of the form Tag(Ts..) where Ts is a pack of types.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant