let_value, let_error, & let_stopped: Dependent set_error_t(std::excep… - #2224
Merged
Merged
Conversation
…tion_ptr) let_value, let_error, and let_stopped have three different kinds of completion signatures: - Those obtained from the sender type returned by the invocable, - Those passed through from the child sender, and - Possibly set_error_t(std::exception_ptr) The latter must be added when: - Decay-copying the apropos result datums of the child sender can throw, - Invoking the invocable with any set of decay-copied result datums can throw, or - Connecting any of the sender types which can be returned by the invocable can throw Note that if the child of let_value, let_error, or let_stopped is not dependent the apropos result datums can be determined without the context of an environment. This means, in turn, that in such a situation it can be determined, without the context of an environment, whether invocation of the invocable can throw (since the type of the decay- copied result datums with which it will be invoked can be known). The last of the bullets above, however, presents a problem in an environment-free context. Computing whether or not a sender can be connected without throwing requires the context of an environment (see P3388). Previously let_value, let_error, and let_stopped unconditionally added set_error_t(std::exception_ptr) in the case where no environment was provided. This created the illusion that the sender was not dependent, and led to compilation failures in situations such as the test added by this commit. The above might seem to imply that let_value, let_error, and let_stopped are always dependent, but this isn't true. In the case where set_error_t(std::exception_ptr) is already a possible completion signature it doesn't matter whether or not connecting the sender returned by the invocable can throw. Reified the above: let_value, let_error, and let_stopped indicate they are dependent when the question of whether or not connecting the sender returned by the invocable throws determines the presence of set_error_t(std::exception_ptr), otherwise they can advertise non- dependent completion signatures.
ericniebler
approved these changes
Aug 22, 2026
Collaborator
|
/ok to test 364da35 |
Collaborator
|
thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tion_ptr)
let_value, let_error, and let_stopped have three different kinds of completion signatures:
The latter must be added when:
Note that if the child of let_value, let_error, or let_stopped is not dependent the apropos result datums can be determined without the context of an environment. This means, in turn, that in such a situation it can be determined, without the context of an environment, whether invocation of the invocable can throw (since the type of the decay- copied result datums with which it will be invoked can be known).
The last of the bullets above, however, presents a problem in an environment-free context. Computing whether or not a sender can be connected without throwing requires the context of an environment (see P3388).
Previously let_value, let_error, and let_stopped unconditionally added set_error_t(std::exception_ptr) in the case where no environment was provided. This created the illusion that the sender was not dependent, and led to compilation failures in situations such as the test added by this commit.
The above might seem to imply that let_value, let_error, and let_stopped are always dependent, but this isn't true. In the case where set_error_t(std::exception_ptr) is already a possible completion signature it doesn't matter whether or not connecting the sender returned by the invocable can throw.
Reified the above: let_value, let_error, and let_stopped indicate they are dependent when the question of whether or not connecting the sender returned by the invocable throws determines the presence of set_error_t(std::exception_ptr), otherwise they can advertise non- dependent completion signatures.
Fixes #2197.