-
Notifications
You must be signed in to change notification settings - Fork 777
P3570R2 optional variants in sender/receiver #8003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AlisdairM
wants to merge
2
commits into
cplusplus:main
Choose a base branch
from
AlisdairM:apply_p3570_optional_variants_in_sender_receiver
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -464,6 +464,7 @@ | |
struct @\libglobal{get_forward_progress_guarantee_t}@ { @\unspec@ }; | ||
template<class CPO> | ||
struct @\libglobal{get_completion_scheduler_t}@ { @\unspec@ }; | ||
struct get_await_completion_adaptor_t { @\unspec@ }; | ||
|
||
inline constexpr get_domain_t @\libglobal{get_domain}@{}; | ||
inline constexpr get_scheduler_t @\libglobal{get_scheduler}@{}; | ||
|
@@ -472,6 +473,7 @@ | |
inline constexpr get_forward_progress_guarantee_t @\libglobal{get_forward_progress_guarantee}@{}; | ||
template<class CPO> | ||
constexpr get_completion_scheduler_t<CPO> @\libglobal{get_completion_scheduler}@{}; | ||
inline constexpr get_await_completion_adaptor_t get_await_completion_adaptor{}; | ||
|
||
struct @\libglobal{get_env_t}@ { @\unspec@ }; | ||
inline constexpr get_env_t @\libglobal{get_env}@{}; | ||
|
@@ -1005,6 +1007,22 @@ | |
\tcode{forwarding_query(get_completion_scheduler<\exposid{completion-tag}>)} | ||
is a core constant expression and has value \tcode{true}. | ||
|
||
\rSec2[exec.get.await.adapt]{\tcode{execution::get_await_completion_adaptor}} | ||
|
||
\pnum | ||
\tcode{get_await_completion_adaptor} asks a queryable object for | ||
its associated awaitable completion adaptor. | ||
|
||
\pnum | ||
The name \tcode{get_await_completion_adaptor} denotes a query object. | ||
For a subexpression \tcode{env}, | ||
\tcode{get_await_completion_adaptor(env)} is expression-equivalent to | ||
\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_await_completion_adaptor))}. | ||
|
||
\pnum | ||
\tcode{forwarding_query(execution::get_await_completion_adaptor)} | ||
is a core constant expression and has value \tcode{true}. | ||
|
||
\rSec1[exec.sched]{Schedulers} | ||
|
||
\pnum | ||
|
@@ -5442,6 +5460,13 @@ | |
{ p.unhandled_stopped() } -> @\libconcept{convertible_to}@<coroutine_handle<>>; | ||
}; | ||
|
||
template<class Sndr> | ||
concept @\defexposconcept{has-queryable-await-completion-adaptor}@ = // \expos | ||
@\libconcept{sender}@<Sndr> && | ||
requires(Sndr&& sender) { | ||
get_await_completion_adaptor(get_env(sender)); | ||
}; | ||
|
||
template<class Sndr, class Promise> | ||
class @\exposidnc{sender-awaitable}@; // \expos | ||
} | ||
|
@@ -5583,6 +5608,13 @@ | |
in a coroutine with promise type \tcode{U} is expression-equivalent to | ||
the same expression in a coroutine with promise type \tcode{Promise}. | ||
\item | ||
Otherwise, \tcode{\exposid{sender-awaitable}\{\exposid{adapted-expr}, p\}} | ||
if \tcode{\exposid{has-queryable-await-completion-adaptor}<Expr>} | ||
and \tcode{\exposid{awaitable-sender}<decltype((\exposid{adapted-expr})), Promise>} | ||
are both satisfied, where \exposid{adapted-expr} is | ||
\tcode{get_await_completion_adaptor(get_env(expr))(expr)}, | ||
except that \tcode{expr} is evaluated only once. | ||
Comment on lines
+5611
to
+5616
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sprinkling in some soft hyphens ( |
||
\item | ||
Otherwise, \tcode{\exposid{sender-awaitable}\{expr, p\}} | ||
if \tcode{\exposconcept{awaitable-sender}<Expr, Promise>} is \tcode{true}. | ||
\item | ||
|
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably resolve the overfull hbox issues in this area by sprinkling some soft hyphens (
\-
) into these long identifiers.