std::execution::dependent_sender_error
| Defined in header <execution>
|
||
struct dependent_sender_error : std::exception {};
|
(since C++26) | |
dependent_sender_error is an exception type used to indicate that a sender's completion signatures cannot be determined without an environment.
When execution::get_completion_signatures<Sndr>() is called without an environment and no applicable member function or awaitable fallback supplies completion signatures, it throws an exception of type dependent_sender_error or an unspecified type publicly and unambiguously derived from it. A sender's own get_completion_signatures member may also throw this exception when queried without an environment, for example to propagate the result of querying a dependent child sender.
The dependent_sender concept detects this exception during constant evaluation. Other exceptions used to report errors by the sender facilities do not match a handler for dependent_sender_error.
Notes
get_completion_signatures is a consteval function. An uncaught exception during its evaluation prevents the expression from being a constant expression; it is not a runtime error completion sent to a receiver.
For example, execution::read_env(std::get_stop_token) produces a dependent sender: the type of the stop token it sends depends on its receiver's environment. Supplying an environment to the completion-signature query allows the signatures to be determined when the query is valid in that environment.
Example
| This section is incomplete Reason: no example |
See also
(C++26) |
specifies that the ways a sender can complete depend on the environment it is started in (concept) |
(C++26) |
specifies that the ways a sender can complete are known, for a given environment or without one (concept) |
| obtains the completion signatures of a sender, or their type (function) | |
(C++26) |
creates a sender that queries its receiver's associated environment (customization point object) |