diff --git a/source/exec.tex b/source/exec.tex index 8fa3c30a24..adc343a554 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -464,6 +464,7 @@ struct @\libglobal{get_forward_progress_guarantee_t}@ { @\unspec@ }; template 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 constexpr get_completion_scheduler_t @\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}@>; }; + template + concept @\defexposconcept{has-queryable-await-completion-adaptor}@ = // \expos + @\libconcept{sender}@ && + requires(Sndr&& sender) { + get_await_completion_adaptor(get_env(sender)); + }; + template 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}} +and \tcode{\exposid{awaitable-sender}} +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. +\item Otherwise, \tcode{\exposid{sender-awaitable}\{expr, p\}} if \tcode{\exposconcept{awaitable-sender}} is \tcode{true}. \item diff --git a/source/support.tex b/source/support.tex index 95d674aafb..bd43787715 100644 --- a/source/support.tex +++ b/source/support.tex @@ -799,7 +799,7 @@ #define @\defnlibxname{cpp_lib_saturation_arithmetic}@ 202311L // also in \libheader{numeric} #define @\defnlibxname{cpp_lib_scoped_lock}@ 201703L // also in \libheader{mutex} #define @\defnlibxname{cpp_lib_semaphore}@ 201907L // also in \libheader{semaphore} -#define @\defnlibxname{cpp_lib_senders}@ 202406L // also in \libheader{execution} +#define @\defnlibxname{cpp_lib_senders}@ 202506L // also in \libheader{execution} #define @\defnlibxname{cpp_lib_shared_mutex}@ 201505L // also in \libheader{shared_mutex} #define @\defnlibxname{cpp_lib_shared_ptr_arrays}@ 201707L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_shared_ptr_weak_type}@ 201606L // also in \libheader{memory}