Skip to content

Commit e0eccf1

Browse files
authored
Merge 2025-06 LWG Motion 18
P3570R2 optional variants in sender/receiver
2 parents 4448006 + 45e2170 commit e0eccf1

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

source/exec.tex

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@
464464
struct @\libglobal{get_forward_progress_guarantee_t}@ { @\unspec@ };
465465
template<class CPO>
466466
struct @\libglobal{get_completion_scheduler_t}@ { @\unspec@ };
467+
struct get_await_completion_adaptor_t { @\unspec@ };
467468

468469
inline constexpr get_domain_t @\libglobal{get_domain}@{};
469470
inline constexpr get_scheduler_t @\libglobal{get_scheduler}@{};
@@ -472,6 +473,7 @@
472473
inline constexpr get_forward_progress_guarantee_t @\libglobal{get_forward_progress_guarantee}@{};
473474
template<class CPO>
474475
constexpr get_completion_scheduler_t<CPO> @\libglobal{get_completion_scheduler}@{};
476+
inline constexpr get_await_completion_adaptor_t get_await_completion_adaptor{};
475477

476478
struct @\libglobal{get_env_t}@ { @\unspec@ };
477479
inline constexpr get_env_t @\libglobal{get_env}@{};
@@ -1007,6 +1009,27 @@
10071009
\tcode{forwarding_query(get_completion_scheduler<\exposid{completion-tag}>)}
10081010
is a core constant expression and has value \tcode{true}.
10091011

1012+
\rSec2[exec.get.await.adapt]{\tcode{execution::get_await_completion_adaptor}}
1013+
1014+
\pnum
1015+
\tcode{get_await_completion_adaptor} asks a queryable object for
1016+
its associated awaitable completion adaptor.
1017+
1018+
\pnum
1019+
The name \tcode{get_await_completion_adaptor} denotes a query object.
1020+
For a subexpression \tcode{env},
1021+
\begin{codeblock}
1022+
get_await_completion_adaptor(env)
1023+
\end{codeblock}
1024+
is expression-equivalent to
1025+
\begin{codeblock}
1026+
@\exposidnc{MANDATE-NOTHROW}@(@\exposid{AS-CONST}@(env).query(get_await_completion_adaptor))
1027+
\end{codeblock}
1028+
1029+
\pnum
1030+
\tcode{forwarding_query(execution::get_await_completion_adaptor)}
1031+
is a core constant expression and has value \tcode{true}.
1032+
10101033
\rSec1[exec.sched]{Schedulers}
10111034

10121035
\pnum
@@ -5489,6 +5512,13 @@
54895512
{ p.unhandled_stopped() } -> @\libconcept{convertible_to}@<coroutine_handle<>>;
54905513
};
54915514

5515+
template<class Sndr>
5516+
concept @\defexposconcept{has-queryable-await-completion-adaptor}@ = // \expos
5517+
@\libconcept{sender}@<Sndr> &&
5518+
requires(Sndr&& sender) {
5519+
get_await_completion_adaptor(get_env(sender));
5520+
};
5521+
54925522
template<class Sndr, class Promise>
54935523
class @\exposidnc{sender-awaitable}@; // \expos
54945524
}
@@ -5630,6 +5660,19 @@
56305660
in a coroutine with promise type \tcode{U} is expression-equivalent to
56315661
the same expression in a coroutine with promise type \tcode{Promise}.
56325662
\item
5663+
Otherwise, \tcode{\exposid{sender-awaitable}\{\exposid{adapted-expr}, p\}}
5664+
if
5665+
\begin{codeblock}
5666+
@\exposid{has-queryable-await-completion-adaptor}@<Expr>
5667+
\end{codeblock}
5668+
and
5669+
\begin{codeblock}
5670+
@\exposid{awaitable-sender}@<decltype((@\exposid{adapted-expr}@)), Promise>}
5671+
\end{codeblock}
5672+
are both satisfied, where \exposid{adapted-expr} is
5673+
\tcode{get_await_completion_adaptor(get_env(expr))(expr)},
5674+
except that \tcode{expr} is evaluated only once.
5675+
\item
56335676
Otherwise, \tcode{\exposid{sender-awaitable}\{expr, p\}}
56345677
if \tcode{\exposconcept{awaitable-sender}<Expr, Promise>} is \tcode{true}.
56355678
\item

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@
816816
#define @\defnlibxname{cpp_lib_saturation_arithmetic}@ 202311L // also in \libheader{numeric}
817817
#define @\defnlibxname{cpp_lib_scoped_lock}@ 201703L // also in \libheader{mutex}
818818
#define @\defnlibxname{cpp_lib_semaphore}@ 201907L // also in \libheader{semaphore}
819-
#define @\defnlibxname{cpp_lib_senders}@ 202406L // also in \libheader{execution}
819+
#define @\defnlibxname{cpp_lib_senders}@ 202506L // also in \libheader{execution}
820820
#define @\defnlibxname{cpp_lib_shared_mutex}@ 201505L // also in \libheader{shared_mutex}
821821
#define @\defnlibxname{cpp_lib_shared_ptr_arrays}@ 201707L // also in \libheader{memory}
822822
#define @\defnlibxname{cpp_lib_shared_ptr_weak_type}@ 201606L // also in \libheader{memory}

0 commit comments

Comments
 (0)