From 6dffed6538e500b3291851daf5a26d7c84bce3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 29 Jun 2025 18:03:20 +0200 Subject: [PATCH 01/56] applied the changes for P3552r3 I have applied some [I think editorial] changes compared to P3552r3: - added with_error and change_coroutine_scheduler declarations to the synopsis before task; they are in the detailed description but not in the synopsis (possibly they should only be in the synopsis) as there is no further description) - inconsistent default template arguments for the ctor in the class declaration (allocator and the later description (allocator); the wording consistently uses allocator - added "of the" to a sentence about the type of a completion datum: "... defines the type *of the* value completion datum" - the use of the template parameter of the nested type state is Rcvr which has two problems: 1. the ctor also uses the name Rcvr for its template parameter 2. the class stores an object of type R which is the receiver named rcvr the most logic fix is to use Rcvr consistently for the state and change the name for the ctor's parameter: 1. change the ctor template parameter type to use R 2. change the member to use Rcvr 3. change the type R used for the own-env-t to be "...get_env(declval())..." --- source/exceptions.tex | 5 +- source/exec.tex | 776 ++++++++++++++++++++++++++++++++++++++++++ source/support.tex | 1 + 3 files changed, 781 insertions(+), 1 deletion(-) diff --git a/source/exceptions.tex b/source/exceptions.tex index 79684e4c51..de858e4445 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -1126,7 +1126,10 @@ when \tcode{unhandled_stopped} is called on a \tcode{with_awaitable_senders} object\iref{exec.with.awaitable.senders} whose continuation is not a handle to a coroutine -whose promise type has an \tcode{unhandled_stopped} member function. +whose promise type has an \tcode{unhandled_stopped} member function, or + +\item% +when an exception is thrown from a coroutine \tcode{std::execution::task}\iref{exec.task} which doesn’t support a \tcode{std::execution::set_error_t(std::execption_ptr)} completion. \end{itemize} diff --git a/source/exec.tex b/source/exec.tex index 8fa3c30a24..e95ff1a88d 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -708,6 +708,24 @@ // \ref{exec.with.awaitable.senders} template<@\exposconcept{class-type}@ Promise> struct with_awaitable_senders; + + // \ref{exec.affine.on} + struct @\libglobal{affine_on_t}@ { @\unspec@ }; + inline constexpr affine_on_t @\libglobal{affine_on}@{}; + + // \ref{exec.inline.scheduler} + class @\libglobal{inline_scheduler}@; + + // \ref{exec.task.scheduler} + class @\libglobal{task_scheduler}@; + + // \ref{exec.task} + template + struct @\libglobal{with_error}@; + template <@\libconcept{scheduler}@ Sch> + struct @\libglobal{change_coroutine_scheduler}@; + template + class @\libglobal{task}@; } \end{codeblock} @@ -5672,3 +5690,761 @@ return as_awaitable(std::forward(value), static_cast(*this)); \end{codeblock} \end{itemdescr} + +\rSec2[exec.affine.on]{\tcode{execution::affine_on}} + +\pnum \tcode{affine_on} adapts a sender into one that completes on +the specified scheduler. If the algorithm determines that the adapted +sender already completes on the correct scheduler it can avoid any +scheduling operation. + +\pnum The name \tcode{affine_on} denotes a pipeable sender adaptor +object. For subexpressions \tcode{sch} and \tcode{sndr}, if +\tcode{decltype((sch))} does not satisfy \libconcept{scheduler}, or +\tcode{decltype((sndr))} does not satisfy \libconcept{sender}, +\tcode{affine_on(sndr, sch)} is ill-formed. + +\pnum Otherwise, the expression \tcode{affine_on(sndr, sch)} is +expression-equivalent to: +\begin{codeblock} +transform_sender(@\exposid{get-domain-early}@(sndr), @\exposid{make-sender}@(affine_on, sch, sndr)) +\end{codeblock} +except that \tcode{sndr} is evalutated only once. + +\pnum +The exposition-only class template \exposid{impls-for}\iref{exec.snd.general} +is specialized for \tcode{affine_on_t} as follows: + +\begin{codeblock} +namespace std::execution { + template <> + struct @\exposid{impls-for}@: @\exposid{default-impls}@ { + static constexpr auto @\exposid{get-attrs}@ = + [](const auto& data, const auto& child) noexcept -> decltype(auto) { + return @\exposid{JOIN-ENV}@(@\exposid{SCHED-ATTRS}@(data), @\exposid{FWD-ENV}@(get_env(child))); + }; + }; +} +\end{codeblock} + +\pnum Let \tcode{out_sndr} be a subexpression denoting a sender +returned from \tcode{affine_on(sndr, sch)} or one equal to such, +and let \tcode{OutSndr} be the type \tcode{decltype((out_sndr))}. +Let \tcode{out_rcvr} be a subexpression denoting a receiver that +has an environment of type \tcode{Env} such that \tcode{sender_in} +is \tcode{true}. Let \tcode{op} be an lvalue referring to +the operation state that results from connecting \tcode{out_sndr} +to \tcode{out_rcvr}. Calling \tcode{start(op)} will start \tcode{sndr} +on the current execution agent and execute completion operations +on \tcode{out_rcvr} on an execution agent of the execution resource +associated with \tcode{sch}. If the current execution resource is +the same as the execution resource associated with \tcode{sch}, the +completion operation on \tcode{out_rcvr} may be called before +\tcode{start(op)} completes. If scheduling onto \tcode{sch} fails, +an error completion on \tcode{out_rcvr} shall be executed on an +unspecified execution agent. + +\rSec2[exec.inline.scheduler]{\tcode{execution::inline_scheduler}} + +\begin{codeblock} +namespace std::execution { + class @\libglobal{inline_scheduler}@ { + class @\exposidnc{inline-sender}@; // \expos + template <@\libconcept{receiver}@ R> + class @\exposidnc{inline-state}@; // \expos + + public: + using scheduler_concept = scheduler_t; + + constexpr @\exposid{inline-sender}@ schedule() noexcept { return {}; } + constexpr bool operator== (const inline_scheduler&) const noexcept = default; + }; +} +\end{codeblock} + +\pnum \tcode{inline_scheduler} is a class that models +\libconcept{scheduler}\iref{exec.sched}. All objects of type +\tcode{inline_scheduler} are equal. + +\pnum \exposid{inline-sender} is an exposition-only type that satisfies +\libconcept{sender}. The type +\tcode{completion_signatures_of_t<\exposid{inline-sender}>} +is \tcode{completion_signatures}. + +\pnum Let \tcode{sndr} be an expression of type \exposid{inline-sender}, +let \tcode{rcvr} be an expression such that +\tcode{\libconcept{receiver_of}} is {true} +where \tcode{CS} is \tcode{completion_signatures}, +then: + +\begin{itemize} +\item the expression \tcode{connect(sndr, rcvr)} has +type \tcode{\exposid{inline-state}>} +and is potentially-throwing if and only if +\tcode{((void)sndr, auto(rcvr))} is potentially-throwing, and +\item the expression +\tcode{get_completion_scheduler(get_env(sndr))} has +type \tcode{inline_scheduler} and is potentially-throwing if and +only if \tcode{get_env(sndr)} is potentially-throwing. +\end{itemize} + +\pnum Let \tcode{o} be a non-const lvalue of type +\tcode{\exposid{inline-state}}, and let \tcode{REC(o)} be +a non-const lvalue reference to an object of type \tcode{Rcvr} that +was initialized with the expression \tcode{rcvr} passed to an +invocation of \tcode{connect} that returned \tcode{o}, then: + +\begin{itemize} +\item the object to which \tcode{REC(o)} refers remains valid for +the lifetime of the object to which \tcode{o} refers, and +\item the expression \tcode{start(o)} is equivalent to +\tcode{set_value(std::move(REC(o)))}. +\end{itemize} + +\rSec2[exec.task.scheduler]{\tcode{execution::task_scheduler}} + +\begin{codeblock} +namespace std::execution { + class task_scheduler { + class @\exposidnc{sender}@; // \expos + template <@\libconcept{receiver}@ R> + class @\exposidnc{state}@; // \expos + + public: + using scheduler_concept = scheduler_t; + + template > + requires (!same_as>) + && scheduler + explicit task_scheduler(Sch&& sch, Allocator alloc = {}); + + @\exposid{sender}@ schedule(); + + friend bool operator== (const task_scheduler& lhs, const task_scheduler& rhs) + noexcept; + template + requires (!same_as) + && scheduler + friend bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; + + private: + shared_ptr @\exposidnc{sch_}@; // \expos + }; +} +\end{codeblock} + +\pnum \tcode{task_scheduler} is a class that models +\libconcept{scheduler}\iref{exec.sched}. Given on object \tcode{s} +of type \tcode{task_scheduler}, let \tcode{SCHED(s)} be the object +owned by \tcode{s.\exposid{sch_}}. + +\begin{itemdecl} +template > + requires(!same_as>) && scheduler +explicit task_scheduler(Sch&& sch, Allocator alloc = {}); +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects: Initialize \exposid{sch_} with +\tcode{allocate_shared>(alloc, +std::forward(sch))}. + +\pnum \recommended Implementations should avoid the use of dynamically +allocated memory for small scheduler objects. + +\pnum \remarks Any allocations performed by construction of +\exposid{sender} or \exposid{state} objects resulting from calls +on \tcode{*this} are performed using a copy of \tcode{alloc}. +\end{itemdescr} + +\begin{itemdecl} +@\exposid{sender}@ schedule(); +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Returns an object of type \exposid{sender} containing +a sender initialized with \tcode{schedule(SCHED(*this))}. +\end{itemdescr} + +\begin{itemdecl} +bool operator== (const task_scheduler& lhs, const task_scheduler& rhs) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Equivalent to: \tcode{return lhs == SCHED(rhs);} +\end{itemdescr} + +\begin{itemdecl} +template + requires (!same_as) + && scheduler +bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \returns \tcode{false} if type of \tcode{SCHED(lhs)} is not +\tcode{Sch}, otherwise \tcode{SCHED(lhs) == rhs;} +\end{itemdescr} + +\begin{codeblock} +class task_scheduler::@\exposid{sender}@ { // \expos +public: + using sender_concept = sender_t; + + template <@\libconcept{receiver}@ Rcvr> + @\exposid{state}@ connect(Rcvr&& rcvr); +}; +\end{codeblock} + +\pnum \exposid{sender} is an exposition-only class that models +\libconcept{sender}\iref{exec.snd} and for which +\tcode{completion_signatures_of_t<\exposid{sender}>} denotes: + +\begin{codeblock} +completion_signatures< + set_value_t(), + set_error_t(error_code), + set_error_t(exception_ptr), + set_stopped_t()> +\end{codeblock} + +\pnum Let \tcode{sch} be an object of type \tcode{task_scheduler} +and let \tcode{sndr} be an object of type \exposid{sender} obtained +from \tcode{schedule(sch)}. Then +\tcode{get_completion_scheduler(get_env(sndr)) == sch} +is \tcode{true}. The object \tcode{SENDER(sndr)} is the sender +object contained by \tcode{sndr} or an object move constructed from +it. + +\begin{itemdecl} +template<@\libconcept{receiver}@ Rcvr> +@\exposid{state}@ connect(Rcvr&& rcvr); +\end{itemdecl} + +\pnum \effects Let \tcode{r} be an object of a type that models +\libconcept{receiver} and whose completion handlers result in +invoking the corresponding completion handlers of \tcode{rcvr} or +copy thereof. Returns an object of type \tcode{\exposid{state}} +containing an operation state object initialized with +\tcode{connect(SENDER(*this), std::move(r))}. + +\begin{codeblock} +template +class task_scheduler::@\exposid{state}@ { // \expos +public: + using operation_state_concept = operation_state_t; + + void start() & noexcept; +}; +\end{codeblock} + +\pnum \exposid{state} is an exposition-only class template whose +specializations model \libconcept{operation_state}\iref{exec.opstate}. + +\begin{itemdecl} +void start() & noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Equivalent to \tcode{start(st)} where \tcode{st} is +the operation state object contained by \tcode{*this}. +\end{itemdescr} + +\rSec2[exec.task]{\tcode{execution::task}} + +\rSec3[task.overview]{\tcode{task} Overview} + +\pnum The \tcode{task} class template represents a sender that can +be used as the return type of coroutines. The first template parameter +\tcode{T} defines the type of the value completion datum +\iref{exec.async.ops} if \tcode{T} is not \tcode{void}. Otherwise, +there are no value completion datums. Inside coroutines returning +\tcode{task} the operand of \tcode{co_return} (if any) becomes +the argument of \tcode{set_value}. The second template parameter +\tcode{Environment} is used to customize the behavior of \tcode{task}. + +\rSec3[task.class]{Class template \tcode{task}} + +\begin{codeblock} +namespace std::execution { + template + class task { + // \ref{task.state} + template + class @\exposidnc{state}@; // \expos + + public: + using sender_concept = sender_t; + using completion_signatures = @\seebelow@; + using allocator_type = @\seebelow@; + using scheduler_type = @\seebelow@; + using stop_source_type = @\seebelow@; + using stop_token_type = decltype(declval().get_token()); + using error_types = @\seebelow@; + + // \ref{task.promise} + class promise_type; + + task(task&&) noexcept; + ~task(); + + template + @\exposid{state}@ connect(Rcvr&& rcvr); + + private: + coroutine_handle @\exposidnc{handle}@; // \expos + }; +} +\end{codeblock} + +\pnum \tcode{task} models \libconcept{sender}\iref{exec.snd} +if \tcode{T} is \tcode{void}, a reference type, or an \cv{}-unqualified +non-array object type and \tcode{E} is a class type. Otherwise a program +that instantiates the definition of \tcode{task} is ill-formed. + +\pnum The nested types of \tcode{task} template specializations +are determined based on the \tcode{Environment} parameter: + +\begin{itemize} +\item \tcode{allocator_type} is \tcode{Environment::allocator_type} +if that qualified-id is valid and denotes a type, \tcode{allocator} +otherwise. +\item \tcode{scheduler_type} is \tcode{Environment::scheduler_type} +if that qualified-id is valid and denotes a type, \tcode{task_scheduler} +otherwise. +\item \tcode{stop_source_type} is \tcode{Environment::stop_source_type} +if that qualified-id is valid and denotes a type, +\tcode{inplace_stop_source} otherwise. +\item \tcode{error_types} is \tcode{Environment::error_types} if +that qualified-id is valid and denotes a type, +\tcode{completion_signatures} otherwise. +\end{itemize} + +\pnum A program is ill-formed if \tcode{error_types} is not a +specialization of \tcode{completion_signatures} or +\tcode{ErrorSigs} contains an element which is not of the form +\tcode{set_error_t(E)} for some type \tcode{E}. + +\pnum The type alias \tcode{completion_signatures} is a specialization +of \tcode{execution::completion_signatures} with the template +arguments (in unspecified order): + +\begin{itemize} +\item \tcode{set_value_t()} if \tcode{T} is \tcode{void}, and +\tcode{set_value_t(T)} otherwise; +\item template arguments of the specialization of +\tcode{execution::completion_signatures} denoted by \tcode{error_types}; +and +\item \tcode{set_stopped_t()}. +\end{itemize} + +\pnum \tcode{allocator_type} shall meet the \libconcept{Cpp17Allocator} +requirements. + +\rSec3[task.members]{\tcode{task} Members} + +\begin{itemdecl} +task(task&& other) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Initializes \exposid{handle} with +\tcode{exchange(other.\exposid{handle}, \{\})}. +\end{itemdescr} + +\begin{itemdecl} +~task(); +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Equivalent to: + +\begin{codeblock} +if (@\exposid{handle}@) + @\exposid{handle}@.destroy(); +\end{codeblock} +\end{itemdescr} + +\begin{itemdecl} +template <@\libconcept{receiver}@ R> +@\exposid{state}@ connect(R&& recv); +\end{itemdecl} + +\begin{itemdescr} +\pnum \expects \tcode{bool(\exposid{handle})} is \tcode{true}. + +\pnum \effects Equivalent to: \tcode{return +\exposid{state}(exchange(\exposid{handle}, \{\}), +std::forward(recv));} +\end{itemdescr} + +\rSec3[task.state]{\tcode{Class template \tcode{task::state}}} + +\begin{codeblock} +namespace std::execution { + template + template + class task::@\exposid{state}@ { // \expos + public: + using operation_state_concept = operation_state_t; + + template + @\exposid{state}@(coroutine_handle h, R&& rr); + ~@\exposid{state}@(); + void start() & noexcept; + +private: + using @\exposidnc{own-env-t}@ = @\seebelow@; // \expos + coroutine_handle @\exposidnc{handle}@; // \expos + remove_cvref_t @\exposidnc{rcvr}@; // \expos + @\exposid{own-env-t}@ @\exposidnc{own-env}@; // \expos + Environment @\exposidnc{environment}@; // \expos + }; +} +\end{codeblock} + +\begin{itemdescr} +\pnum The type \exposid{own-env-t} is \tcode{Environment::template +env_type()))>} if that qualified-id is +valid and denotes a type, \tcode{env<>} otherwise. +\end{itemdescr} + +\begin{itemdecl} +template +@\exposid{state}@(coroutine_handle h, R&& rr); +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Initializes + +\item \exposid{handle} with \tcode{std::move(h)}; +\item \exposid{rcvr} with \tcode{std::forward(rr)}; +\item \exposid{own-env} + with \tcode{\exposid{own-env-t}(get_env(\exposid{rcvr}))} if that expression + is valid and \tcode{\exposid{own-env-t}()} otherwise. + If neither of these expressions is valid, the program is ill-formed. +\item \exposid{environment} with \tcode{Environment(\exposid{own-env})} if that expression is + valid, otherwise \tcode{Environment(get_env(\exposid{rcvr}))} + if this expression is valid, otherwise \tcode{Environment()}. + If neither of these expressions is valid, the program is ill-formed. +\end{itemdescr} + +\begin{itemdecl} +~@\exposid{state}@(); +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Equivalent to: + +\begin{codeblock} +if (@\exposid{handle}@) + @\exposid{handle}@.destroy(); +\end{codeblock} +\end{itemdescr} + +\begin{itemdecl} +void start() & noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Let \tcode{prom} be the object +\tcode{\exposid{handle}.promise()}. Associates +\tcode{STATE(prom)}, \tcode{RCVR(prom)}, +and \tcode{SCHED(prom)} with \tcode{*this} as follows: + +\begin{itemize} +\item \tcode{STATE(prom)} is \tcode{*this}. +\item \tcode{RCVR(prom)} is \tcode{\exposid{rcvr}}. +\item \tcode{SCHED(prom)} is the object initialized +with \tcode{scheduler_type(get_scheduler(get_env(\exposid{rcvr})))} +if that expression is valid and \tcode{scheduler_type()} otherwise. +If neither of these expressions is valid, the program is ill-formed. +\end{itemize} + +Let \tcode{st} be \tcode{get_stop_token(get_env(\exposid{rcvr}))}. +Initializes \tcode{prom.\exposid{token}} and +\tcode{prom.\exposid{source}} such that + +\begin{itemize} +\item \tcode{prom.\exposid{token}.stop_requested()} returns +\tcode{st.stop_requested()}; +\item \tcode{prom.\exposid{token}.stop_possible()} returns +\tcode{st.stop_possible()}; and +\item for types \tcode{Fn} and \tcode{Init} such that both +\tcode{invocable} and \tcode{constructible_from} are +modeled, \tcode{stop_token_type::callback_type} models +\tcode{\exposid{stoppable-callback-for}}. +\end{itemize} + +After that invokes \tcode{\exposid{handle}.resume()}. +\end{itemdescr} + +\rSec3[task.promise]{Class \tcode{task::promise_type}} + +\begin{codeblock} +namespace std::execution { + template + struct with_error { + using type = remove_cvref_t; + type error; + }; + template + with_error(E) -> with_error; + + template <@\libconcept{scheduler}@ Sch> + struct change_coroutine_scheduler { + using type = remove_cvref_t; + type scheduler; + }; + template <@\libconcept{scheduler}@ Sch> + change_coroutine_scheduler(Sch) -> change_coroutine_scheduler; + + template + class task::promise_type { + public: + template + promise_type(const Args&... args); + + task get_return_object() noexcept; + + auto initial_suspend() noexcept; + auto final_suspend() noexcept; + + void uncaught_exception(); + coroutine_handle<> unhandled_stopped(); + + void return_void(); // present only if is_void_v is true; + template + void return_value(V&& value); // present only if is_void_v is false; + + template + @\unspec@ yield_value(with_error error); + + template + auto await_transform(A&& a); + template + auto await_transform(change_coroutine_scheduler sch); + + @\unspec@ get_env() const noexcept; + + template + void* operator new(size_t size, Args&&... args); + + void operator delete(void* pointer, size_t size) noexcept; + + private: + using @\exposidnc{error-variant}@ = @\seebelow@; // \expos + + allocator_type @\exposidnc{alloc}@; // \expos + stop_source_type @\exposidnc{source}@; // \expos + stop_token_type @\exposidnc{token}@; // \expos + optional @\exposidnc{result}@; // \expos; present only if is_void_v is false; + @\exposid{error-variant}@ @\exposidnc{errors}@; // \expos + }; +} +\end{codeblock} + +\pnum Let \tcode{prom} be an object of \tcode{promise_type} and let \tcode{tsk} be +the \tcode{task} object created by \tcode{prom.get_return_object()}. The +description below refers to objects \tcode{STATE(prom)}, +\tcode{RCVR(prom)}, and \tcode{SCHED(prom)} associated +with \tcode{tsk} during evalutation of \tcode{task::\exposid{state}::start} +for some receiver \tcode{Rcvr}. + +\pnum \tcode{\exposid{error-variant}} is a \tcode{variant...>}, with duplicate types removed, where \tcode{E...} +are template arguments of the specialization of +\tcode{execution::completion_signatures} denoted by +\tcode{error_types}. + +\begin{itemdecl} +template +promise_type(const Args&... args); +\end{itemdecl} + +\begin{itemdescr} +\pnum \mandates The first parameter of type \tcode{allocator_arg_t} (if +any) is not the last parameter. + +\pnum \effects If \tcode{Args} contains an element of type \tcode{allocator_arg_t} +then \tcode{\exposid{alloc}} is initialized with the corresponding next +element of \tcode{args}. Otherwise, \tcode{\exposid{alloc}} is initialized +with \tcode{allocator_type()}. +\end{itemdescr} + +\begin{itemdecl} +task get_return_object() noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \returns A \tcode{task} object whose member \tcode{\exposid{handle}} +is \tcode{coroutine_handle::from_promise(*this)}. +\end{itemdescr} + +\begin{itemdecl} +auto initial_suspend() noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \returns An awaitable object of unspecified type \iref{expr.await} +whose member functions arrange for + +\begin{itemize} +\item the calling coroutine to be suspended, +\item the coroutine to be resumed on an execution agent of the +execution resource associated with \tcode{SCHED(*this)}. +\end{itemize} +\end{itemdescr} + +\begin{itemdecl} +auto final_suspend() noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \returns An awaitable object of unspecified type + \iref{expr.await} whose member functions arrange for the completion + of the asynchronous operation associated with \tcode{STATE(*this)} by invoking: + +\begin{itemize} +\item + \tcode{set_error(std::move(RCVR(*this)), std::move(e))} + if \tcode{\exposid{errors}.index()} is greater than zero and + \tcode{e} is the value held by \tcode{\exposid{errors}}, otherwise +\item + \tcode{set_value(std::move(RCVR(*this)))} if \tcode{is_void} is \tcode{true}, + and otherwise +\item + \tcode{set_value(std::move(RCVR(*this)), *\exposid{result})}. +\end{itemize} +\end{itemdescr} + +\begin{itemdecl} +template +auto yield_value(with_error err); +\end{itemdecl} + +\begin{itemdescr} +\pnum \mandates \tcode{std::move(err.error)} is convertible to + exactly one of the \tcode{set_error_t} argument types of \tcode{error_types}. Let \tcode{Cerr} + be that type. + +\pnum \returns An awaitable object of unspecified type + \iref{expr.await} whose member functions arrange for the calling + coroutine to be suspended and then completes + the asynchronous operation associated with \tcode{STATE(*this)} by invoking + \tcode{set_error(std::move(RCVR(*this)), Cerr(std::move(err.error)))}. +\end{itemdescr} + +\begin{itemdecl} +template <@\libconcept{sender}@ Sender> +auto await_transform(Sender&& sndr) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \returns If \tcode{same_as} is + \tcode{true} returns \tcode{as_awaitable(std::forward (sndr), *this)}; + otherwise returns + \tcode{as_awaitable(affine_on(std::forward(sndr), SCHED(*this)), *this)}. +\end{itemdescr} + +\begin{itemdecl} +template +auto await_transform(change_coroutine_scheduler sch) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Equivalent to: \tcode{returns +await_transform(just(exchange(SCHED(*this), +scheduler_type (sch.scheduler))), *this);} +\end{itemdescr} + +\begin{itemdecl} +void uncaught_exception(); +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects If the signature \tcode{set_error_t(exception_ptr)} is + not an element of \tcode{error_types}, calls \tcode{terminate()} + \iref{except.terminate}. Otherwise, stores + \tcode{current_exception()} into \tcode{\exposid{errors}}. +\end{itemdescr} + +\begin{itemdecl} +coroutine_handle<> unhandled_stopped(); +\end{itemdecl} + +\begin{itemdescr} +\pnum \effects Completes the asynchronous operation + associated with \tcode{STATE(*this)} by invoking + \tcode{set_stopped(std::move(RCVR(*this)))}. +\end{itemdescr} + +\begin{itemdescr} +\pnum \returns \tcode{noop_coroutine()}. +\end{itemdescr} + +\begin{itemdecl} +@\unspec@ get_env() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \returns An object \tcode{env} + such that queries are forwarded as follows: + +\begin{itemize} +\item \tcode{env.query(get_scheduler)} returns \tcode{scheduler_type(SCHED(*this))}. +\item \tcode{env.query(get_allocator)} returns \tcode{\exposid{alloc}}. +\item \tcode{env.query(get_stop_token)} returns \tcode{\exposid{token}}. +\item For any other query \tcode{q} and arguments \tcode{a...} a + call to \tcode{env.query(q, a...)} returns + \tcode{STATE(*this).} \tcode{environment.query(q, a...)} if this expression + is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}. Otherwise + \tcode{env.query(q, a...)} is ill-formed. +\end{itemize} +\end{itemdescr} + +\begin{itemdecl} +template +void* operator new(size_t size, const Args&... args); +\end{itemdecl} + +\begin{itemdescr} +\pnum If there is no parameter with type \tcode{allocator_arg_t} + then let \tcode{alloc} be \tcode{Allocator()}. Let \tcode{arg_next} be the + parameter following the first \tcode{allocator_arg_t} parameter (if + any) and let \tcode{alloc} be \tcode{Allocator(arg_next)}. Then \tcode{PAlloc} + is \tcode{allocator_traits::template rebind_alloc} where + \tcode{U} is an unspecified type whose size and alignment are both + \tcode{__STDCPP_DEFAULT_NEW_ALIGNMENT__}. + +\pnum \mandates + +\begin{itemize} +\item The first parameter of type \tcode{allocator_arg_t} (if any) is not the last parameter. +\item \tcode{Allocator(arg_next)} is a valid expression if there is a parameter + of type \tcode{allocator_arg_t}. +\item \tcode{allocator_traits::pointer} is a pointer type. +\end{itemize} + +\pnum \effects Initializes an allocator \tcode{palloc} of type \tcode{PAlloc} + with \tcode{alloc}. Uses \tcode{palloc} to allocate storage for the smallest + array of \tcode{U} sufficient to provide storage for a coroutine state + of size \tcode{size}, and unspecified additional state necessary to + ensure that \tcode{operator delete} can later deallocate this memory + block with an allocator equal to \tcode{palloc}. + +\pnum \returns A pointer to the allocated storage. +\end{itemdescr} + +\begin{itemdecl} +void operator delete(void* pointer, size_t size) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum \expects \tcode{pointer} was returned from an invocation + of the above overload of \tcode{operator new} with a size argument + equal to \tcode{size}. + +\pnum \effects Deallocates the storage pointed to by \tcode{pointer} + using an allocator equal to that used to allocate it. +\end{itemdescr} diff --git a/source/support.tex b/source/support.tex index 95d674aafb..6baa7f58fb 100644 --- a/source/support.tex +++ b/source/support.tex @@ -825,6 +825,7 @@ #define @\defnlibxname{cpp_lib_string_view}@ 202403L // also in \libheader{string}, \libheader{string_view} #define @\defnlibxname{cpp_lib_submdspan}@ 202411L // freestanding, also in \libheader{mdspan} #define @\defnlibxname{cpp_lib_syncbuf}@ 201803L // also in \libheader{syncstream} +#define @\defnlibxname{cpp_lib_task}@ 202506L // also in \libheader{execution} #define @\defnlibxname{cpp_lib_text_encoding}@ 202306L // also in \libheader{text_encoding} #define @\defnlibxname{cpp_lib_three_way_comparison}@ 201907L // freestanding, also in \libheader{compare} #define @\defnlibxname{cpp_lib_to_address}@ 201711L // freestanding, also in \libheader{memory} From de6b8e0cd033f3cd700af1d1d4b097dea63e88e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 29 Jun 2025 18:34:43 +0200 Subject: [PATCH 02/56] Fixup: actioned CI feedback --- source/exec.tex | 255 +++++++++++++++++++++++++++++------------------- 1 file changed, 155 insertions(+), 100 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index e95ff1a88d..d2d3f10eed 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -720,11 +720,11 @@ class @\libglobal{task_scheduler}@; // \ref{exec.task} - template + template struct @\libglobal{with_error}@; - template <@\libconcept{scheduler}@ Sch> + template<@\libconcept{scheduler}@ Sch> struct @\libglobal{change_coroutine_scheduler}@; - template + template class @\libglobal{task}@; } \end{codeblock} @@ -5693,18 +5693,21 @@ \rSec2[exec.affine.on]{\tcode{execution::affine_on}} -\pnum \tcode{affine_on} adapts a sender into one that completes on +\pnum +\tcode{affine_on} adapts a sender into one that completes on the specified scheduler. If the algorithm determines that the adapted sender already completes on the correct scheduler it can avoid any scheduling operation. -\pnum The name \tcode{affine_on} denotes a pipeable sender adaptor +\pnum +The name \tcode{affine_on} denotes a pipeable sender adaptor object. For subexpressions \tcode{sch} and \tcode{sndr}, if \tcode{decltype((sch))} does not satisfy \libconcept{scheduler}, or \tcode{decltype((sndr))} does not satisfy \libconcept{sender}, \tcode{affine_on(sndr, sch)} is ill-formed. -\pnum Otherwise, the expression \tcode{affine_on(sndr, sch)} is +\pnum +Otherwise, the expression \tcode{affine_on(sndr, sch)} is expression-equivalent to: \begin{codeblock} transform_sender(@\exposid{get-domain-early}@(sndr), @\exposid{make-sender}@(affine_on, sch, sndr)) @@ -5717,7 +5720,7 @@ \begin{codeblock} namespace std::execution { - template <> + template<> struct @\exposid{impls-for}@: @\exposid{default-impls}@ { static constexpr auto @\exposid{get-attrs}@ = [](const auto& data, const auto& child) noexcept -> decltype(auto) { @@ -5727,7 +5730,8 @@ } \end{codeblock} -\pnum Let \tcode{out_sndr} be a subexpression denoting a sender +\pnum +Let \tcode{out_sndr} be a subexpression denoting a sender returned from \tcode{affine_on(sndr, sch)} or one equal to such, and let \tcode{OutSndr} be the type \tcode{decltype((out_sndr))}. Let \tcode{out_rcvr} be a subexpression denoting a receiver that @@ -5750,7 +5754,7 @@ namespace std::execution { class @\libglobal{inline_scheduler}@ { class @\exposidnc{inline-sender}@; // \expos - template <@\libconcept{receiver}@ R> + template<@\libconcept{receiver}@ R> class @\exposidnc{inline-state}@; // \expos public: @@ -5762,16 +5766,19 @@ } \end{codeblock} -\pnum \tcode{inline_scheduler} is a class that models +\pnum +\tcode{inline_scheduler} is a class that models \libconcept{scheduler}\iref{exec.sched}. All objects of type \tcode{inline_scheduler} are equal. -\pnum \exposid{inline-sender} is an exposition-only type that satisfies +\pnum +\exposid{inline-sender} is an exposition-only type that satisfies \libconcept{sender}. The type \tcode{completion_signatures_of_t<\exposid{inline-sender}>} is \tcode{completion_signatures}. -\pnum Let \tcode{sndr} be an expression of type \exposid{inline-sender}, +\pnum +Let \tcode{sndr} be an expression of type \exposid{inline-sender}, let \tcode{rcvr} be an expression such that \tcode{\libconcept{receiver_of}} is {true} where \tcode{CS} is \tcode{completion_signatures}, @@ -5788,7 +5795,8 @@ only if \tcode{get_env(sndr)} is potentially-throwing. \end{itemize} -\pnum Let \tcode{o} be a non-const lvalue of type +\pnum +Let \tcode{o} be a non-const lvalue of type \tcode{\exposid{inline-state}}, and let \tcode{REC(o)} be a non-const lvalue reference to an object of type \tcode{Rcvr} that was initialized with the expression \tcode{rcvr} passed to an @@ -5807,13 +5815,13 @@ namespace std::execution { class task_scheduler { class @\exposidnc{sender}@; // \expos - template <@\libconcept{receiver}@ R> + template<@\libconcept{receiver}@ R> class @\exposidnc{state}@; // \expos public: using scheduler_concept = scheduler_t; - template > + template> requires (!same_as>) && scheduler explicit task_scheduler(Sch&& sch, Allocator alloc = {}); @@ -5822,7 +5830,7 @@ friend bool operator== (const task_scheduler& lhs, const task_scheduler& rhs) noexcept; - template + template requires (!same_as) && scheduler friend bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; @@ -5833,26 +5841,30 @@ } \end{codeblock} -\pnum \tcode{task_scheduler} is a class that models +\pnum +\tcode{task_scheduler} is a class that models \libconcept{scheduler}\iref{exec.sched}. Given on object \tcode{s} of type \tcode{task_scheduler}, let \tcode{SCHED(s)} be the object owned by \tcode{s.\exposid{sch_}}. \begin{itemdecl} -template > +template> requires(!same_as>) && scheduler explicit task_scheduler(Sch&& sch, Allocator alloc = {}); \end{itemdecl} \begin{itemdescr} -\pnum \effects: Initialize \exposid{sch_} with +\pnum +\effects: Initialize \exposid{sch_} with \tcode{allocate_shared>(alloc, std::forward(sch))}. -\pnum \recommended Implementations should avoid the use of dynamically +\pnum +\recommended Implementations should avoid the use of dynamically allocated memory for small scheduler objects. -\pnum \remarks Any allocations performed by construction of +\pnum +\remarks Any allocations performed by construction of \exposid{sender} or \exposid{state} objects resulting from calls on \tcode{*this} are performed using a copy of \tcode{alloc}. \end{itemdescr} @@ -5862,7 +5874,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects Returns an object of type \exposid{sender} containing +\pnum +\effects Returns an object of type \exposid{sender} containing a sender initialized with \tcode{schedule(SCHED(*this))}. \end{itemdescr} @@ -5871,18 +5884,20 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects Equivalent to: \tcode{return lhs == SCHED(rhs);} +\pnum +\effects Equivalent to: \tcode{return lhs == SCHED(rhs);} \end{itemdescr} \begin{itemdecl} -template +template requires (!same_as) && scheduler bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; \end{itemdecl} \begin{itemdescr} -\pnum \returns \tcode{false} if type of \tcode{SCHED(lhs)} is not +\pnum +\returns \tcode{false} if type of \tcode{SCHED(lhs)} is not \tcode{Sch}, otherwise \tcode{SCHED(lhs) == rhs;} \end{itemdescr} @@ -5891,12 +5906,13 @@ public: using sender_concept = sender_t; - template <@\libconcept{receiver}@ Rcvr> + template<@\libconcept{receiver}@ Rcvr> @\exposid{state}@ connect(Rcvr&& rcvr); }; \end{codeblock} -\pnum \exposid{sender} is an exposition-only class that models +\pnum +\exposid{sender} is an exposition-only class that models \libconcept{sender}\iref{exec.snd} and for which \tcode{completion_signatures_of_t<\exposid{sender}>} denotes: @@ -5908,7 +5924,8 @@ set_stopped_t()> \end{codeblock} -\pnum Let \tcode{sch} be an object of type \tcode{task_scheduler} +\pnum +Let \tcode{sch} be an object of type \tcode{task_scheduler} and let \tcode{sndr} be an object of type \exposid{sender} obtained from \tcode{schedule(sch)}. Then \tcode{get_completion_scheduler(get_env(sndr)) == sch} @@ -5921,7 +5938,8 @@ @\exposid{state}@ connect(Rcvr&& rcvr); \end{itemdecl} -\pnum \effects Let \tcode{r} be an object of a type that models +\pnum +\effects Let \tcode{r} be an object of a type that models \libconcept{receiver} and whose completion handlers result in invoking the corresponding completion handlers of \tcode{rcvr} or copy thereof. Returns an object of type \tcode{\exposid{state}} @@ -5929,7 +5947,7 @@ \tcode{connect(SENDER(*this), std::move(r))}. \begin{codeblock} -template +template class task_scheduler::@\exposid{state}@ { // \expos public: using operation_state_concept = operation_state_t; @@ -5938,7 +5956,8 @@ }; \end{codeblock} -\pnum \exposid{state} is an exposition-only class template whose +\pnum +\exposid{state} is an exposition-only class template whose specializations model \libconcept{operation_state}\iref{exec.opstate}. \begin{itemdecl} @@ -5946,7 +5965,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects Equivalent to \tcode{start(st)} where \tcode{st} is +\pnum +\effects Equivalent to \tcode{start(st)} where \tcode{st} is the operation state object contained by \tcode{*this}. \end{itemdescr} @@ -5954,7 +5974,8 @@ \rSec3[task.overview]{\tcode{task} Overview} -\pnum The \tcode{task} class template represents a sender that can +\pnum +The \tcode{task} class template represents a sender that can be used as the return type of coroutines. The first template parameter \tcode{T} defines the type of the value completion datum \iref{exec.async.ops} if \tcode{T} is not \tcode{void}. Otherwise, @@ -5967,10 +5988,10 @@ \begin{codeblock} namespace std::execution { - template + template class task { // \ref{task.state} - template + template class @\exposidnc{state}@; // \expos public: @@ -5988,7 +6009,7 @@ task(task&&) noexcept; ~task(); - template + template @\exposid{state}@ connect(Rcvr&& rcvr); private: @@ -5997,12 +6018,14 @@ } \end{codeblock} -\pnum \tcode{task} models \libconcept{sender}\iref{exec.snd} +\pnum +\tcode{task} models \libconcept{sender}\iref{exec.snd} if \tcode{T} is \tcode{void}, a reference type, or an \cv{}-unqualified non-array object type and \tcode{E} is a class type. Otherwise a program that instantiates the definition of \tcode{task} is ill-formed. -\pnum The nested types of \tcode{task} template specializations +\pnum +The nested types of \tcode{task} template specializations are determined based on the \tcode{Environment} parameter: \begin{itemize} @@ -6020,12 +6043,14 @@ \tcode{completion_signatures} otherwise. \end{itemize} -\pnum A program is ill-formed if \tcode{error_types} is not a +\pnum + A program is ill-formed if \tcode{error_types} is not a specialization of \tcode{completion_signatures} or \tcode{ErrorSigs} contains an element which is not of the form \tcode{set_error_t(E)} for some type \tcode{E}. -\pnum The type alias \tcode{completion_signatures} is a specialization +\pnum +The type alias \tcode{completion_signatures} is a specialization of \tcode{execution::completion_signatures} with the template arguments (in unspecified order): @@ -6038,7 +6063,8 @@ \item \tcode{set_stopped_t()}. \end{itemize} -\pnum \tcode{allocator_type} shall meet the \libconcept{Cpp17Allocator} +\pnum +\tcode{allocator_type} shall meet the \libconcept{Cpp17Allocator} requirements. \rSec3[task.members]{\tcode{task} Members} @@ -6048,7 +6074,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects Initializes \exposid{handle} with +\pnum +\effects Initializes \exposid{handle} with \tcode{exchange(other.\exposid{handle}, \{\})}. \end{itemdescr} @@ -6057,7 +6084,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects Equivalent to: +\pnum +\effects Equivalent to: \begin{codeblock} if (@\exposid{handle}@) @@ -6066,14 +6094,16 @@ \end{itemdescr} \begin{itemdecl} -template <@\libconcept{receiver}@ R> +template<@\libconcept{receiver}@ R> @\exposid{state}@ connect(R&& recv); \end{itemdecl} \begin{itemdescr} -\pnum \expects \tcode{bool(\exposid{handle})} is \tcode{true}. +\pnum +\expects \tcode{bool(\exposid{handle})} is \tcode{true}. -\pnum \effects Equivalent to: \tcode{return +\pnum +\effects Equivalent to: \tcode{return \exposid{state}(exchange(\exposid{handle}, \{\}), std::forward(recv));} \end{itemdescr} @@ -6082,13 +6112,13 @@ \begin{codeblock} namespace std::execution { - template - template + template + template class task::@\exposid{state}@ { // \expos public: using operation_state_concept = operation_state_t; - template + template @\exposid{state}@(coroutine_handle h, R&& rr); ~@\exposid{state}@(); void start() & noexcept; @@ -6104,18 +6134,20 @@ \end{codeblock} \begin{itemdescr} -\pnum The type \exposid{own-env-t} is \tcode{Environment::template +\pnum +The type \exposid{own-env-t} is \tcode{Environment::template env_type()))>} if that qualified-id is valid and denotes a type, \tcode{env<>} otherwise. \end{itemdescr} \begin{itemdecl} -template +template @\exposid{state}@(coroutine_handle h, R&& rr); \end{itemdecl} \begin{itemdescr} -\pnum \effects Initializes +\pnum +\effects Initializes \item \exposid{handle} with \tcode{std::move(h)}; \item \exposid{rcvr} with \tcode{std::forward(rr)}; @@ -6134,7 +6166,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects Equivalent to: +\pnum +\effects Equivalent to: \begin{codeblock} if (@\exposid{handle}@) @@ -6147,14 +6180,15 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects Let \tcode{prom} be the object +\pnum +\effects Let \tcode{prom} be the object \tcode{\exposid{handle}.promise()}. Associates \tcode{STATE(prom)}, \tcode{RCVR(prom)}, and \tcode{SCHED(prom)} with \tcode{*this} as follows: \begin{itemize} \item \tcode{STATE(prom)} is \tcode{*this}. -\item \tcode{RCVR(prom)} is \tcode{\exposid{rcvr}}. +\item \tcode{RCVR(prom)} is \exposid{rcvr}. \item \tcode{SCHED(prom)} is the object initialized with \tcode{scheduler_type(get_scheduler(get_env(\exposid{rcvr})))} if that expression is valid and \tcode{scheduler_type()} otherwise. @@ -6183,26 +6217,26 @@ \begin{codeblock} namespace std::execution { - template + template struct with_error { using type = remove_cvref_t; type error; }; - template + template with_error(E) -> with_error; - template <@\libconcept{scheduler}@ Sch> + template<@\libconcept{scheduler}@ Sch> struct change_coroutine_scheduler { using type = remove_cvref_t; type scheduler; }; - template <@\libconcept{scheduler}@ Sch> + template<@\libconcept{scheduler}@ Sch> change_coroutine_scheduler(Sch) -> change_coroutine_scheduler; - template + template class task::promise_type { public: - template + template promise_type(const Args&... args); task get_return_object() noexcept; @@ -6213,21 +6247,21 @@ void uncaught_exception(); coroutine_handle<> unhandled_stopped(); - void return_void(); // present only if is_void_v is true; - template - void return_value(V&& value); // present only if is_void_v is false; + void return_void(); // present only if is_void_v is true; + template + void return_value(V&& value); // present only if is_void_v is false; - template + template @\unspec@ yield_value(with_error error); - template + template auto await_transform(A&& a); - template + template auto await_transform(change_coroutine_scheduler sch); @\unspec@ get_env() const noexcept; - template + template void* operator new(size_t size, Args&&... args); void operator delete(void* pointer, size_t size) noexcept; @@ -6244,31 +6278,35 @@ } \end{codeblock} -\pnum Let \tcode{prom} be an object of \tcode{promise_type} and let \tcode{tsk} be +\pnum +Let \tcode{prom} be an object of \tcode{promise_type} and let \tcode{tsk} be the \tcode{task} object created by \tcode{prom.get_return_object()}. The description below refers to objects \tcode{STATE(prom)}, \tcode{RCVR(prom)}, and \tcode{SCHED(prom)} associated with \tcode{tsk} during evalutation of \tcode{task::\exposid{state}::start} for some receiver \tcode{Rcvr}. -\pnum \tcode{\exposid{error-variant}} is a \tcode{variant...>}, with duplicate types removed, where \tcode{E...} are template arguments of the specialization of \tcode{execution::completion_signatures} denoted by \tcode{error_types}. \begin{itemdecl} -template +template promise_type(const Args&... args); \end{itemdecl} \begin{itemdescr} -\pnum \mandates The first parameter of type \tcode{allocator_arg_t} (if +\pnum +\mandates The first parameter of type \tcode{allocator_arg_t} (if any) is not the last parameter. -\pnum \effects If \tcode{Args} contains an element of type \tcode{allocator_arg_t} -then \tcode{\exposid{alloc}} is initialized with the corresponding next -element of \tcode{args}. Otherwise, \tcode{\exposid{alloc}} is initialized +\pnum +\effects If \tcode{Args} contains an element of type \tcode{allocator_arg_t} +then \exposid{alloc} is initialized with the corresponding next +element of \tcode{args}. Otherwise, \exposid{alloc} is initialized with \tcode{allocator_type()}. \end{itemdescr} @@ -6277,7 +6315,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum \returns A \tcode{task} object whose member \tcode{\exposid{handle}} +\pnum +\returns A \tcode{task} object whose member \exposid{handle} is \tcode{coroutine_handle::from_promise(*this)}. \end{itemdescr} @@ -6286,7 +6325,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum \returns An awaitable object of unspecified type \iref{expr.await} +\pnum +\returns An awaitable object of unspecified type \iref{expr.await} whose member functions arrange for \begin{itemize} @@ -6301,7 +6341,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum \returns An awaitable object of unspecified type +\pnum +\returns An awaitable object of unspecified type \iref{expr.await} whose member functions arrange for the completion of the asynchronous operation associated with \tcode{STATE(*this)} by invoking: @@ -6309,7 +6350,7 @@ \item \tcode{set_error(std::move(RCVR(*this)), std::move(e))} if \tcode{\exposid{errors}.index()} is greater than zero and - \tcode{e} is the value held by \tcode{\exposid{errors}}, otherwise + \tcode{e} is the value held by \exposid{errors}, otherwise \item \tcode{set_value(std::move(RCVR(*this)))} if \tcode{is_void} is \tcode{true}, and otherwise @@ -6319,16 +6360,18 @@ \end{itemdescr} \begin{itemdecl} -template +template auto yield_value(with_error err); \end{itemdecl} \begin{itemdescr} -\pnum \mandates \tcode{std::move(err.error)} is convertible to +\pnum +\mandates \tcode{std::move(err.error)} is convertible to exactly one of the \tcode{set_error_t} argument types of \tcode{error_types}. Let \tcode{Cerr} be that type. -\pnum \returns An awaitable object of unspecified type +\pnum +\returns An awaitable object of unspecified type \iref{expr.await} whose member functions arrange for the calling coroutine to be suspended and then completes the asynchronous operation associated with \tcode{STATE(*this)} by invoking @@ -6336,24 +6379,26 @@ \end{itemdescr} \begin{itemdecl} -template <@\libconcept{sender}@ Sender> +template<@\libconcept{sender}@ Sender> auto await_transform(Sender&& sndr) noexcept; \end{itemdecl} \begin{itemdescr} -\pnum \returns If \tcode{same_as} is +\pnum +\returns If \tcode{same_as} is \tcode{true} returns \tcode{as_awaitable(std::forward (sndr), *this)}; otherwise returns \tcode{as_awaitable(affine_on(std::forward(sndr), SCHED(*this)), *this)}. \end{itemdescr} \begin{itemdecl} -template +template auto await_transform(change_coroutine_scheduler sch) noexcept; \end{itemdecl} \begin{itemdescr} -\pnum \effects Equivalent to: \tcode{returns +\pnum +\effects Equivalent to: \tcode{returns await_transform(just(exchange(SCHED(*this), scheduler_type (sch.scheduler))), *this);} \end{itemdescr} @@ -6363,10 +6408,11 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects If the signature \tcode{set_error_t(exception_ptr)} is +\pnum +\effects If the signature \tcode{set_error_t(exception_ptr)} is not an element of \tcode{error_types}, calls \tcode{terminate()} \iref{except.terminate}. Otherwise, stores - \tcode{current_exception()} into \tcode{\exposid{errors}}. + \tcode{current_exception()} into \exposid{errors}. \end{itemdescr} \begin{itemdecl} @@ -6374,13 +6420,15 @@ \end{itemdecl} \begin{itemdescr} -\pnum \effects Completes the asynchronous operation +\pnum +\effects Completes the asynchronous operation associated with \tcode{STATE(*this)} by invoking \tcode{set_stopped(std::move(RCVR(*this)))}. \end{itemdescr} \begin{itemdescr} -\pnum \returns \tcode{noop_coroutine()}. +\pnum +\returns \tcode{noop_coroutine()}. \end{itemdescr} \begin{itemdecl} @@ -6388,13 +6436,14 @@ \end{itemdecl} \begin{itemdescr} -\pnum \returns An object \tcode{env} +\pnum +\returns An object \tcode{env} such that queries are forwarded as follows: \begin{itemize} \item \tcode{env.query(get_scheduler)} returns \tcode{scheduler_type(SCHED(*this))}. -\item \tcode{env.query(get_allocator)} returns \tcode{\exposid{alloc}}. -\item \tcode{env.query(get_stop_token)} returns \tcode{\exposid{token}}. +\item \tcode{env.query(get_allocator)} returns \exposid{alloc}. +\item \tcode{env.query(get_stop_token)} returns \exposid{token}. \item For any other query \tcode{q} and arguments \tcode{a...} a call to \tcode{env.query(q, a...)} returns \tcode{STATE(*this).} \tcode{environment.query(q, a...)} if this expression @@ -6404,12 +6453,13 @@ \end{itemdescr} \begin{itemdecl} -template +template void* operator new(size_t size, const Args&... args); \end{itemdecl} \begin{itemdescr} -\pnum If there is no parameter with type \tcode{allocator_arg_t} +\pnum +If there is no parameter with type \tcode{allocator_arg_t} then let \tcode{alloc} be \tcode{Allocator()}. Let \tcode{arg_next} be the parameter following the first \tcode{allocator_arg_t} parameter (if any) and let \tcode{alloc} be \tcode{Allocator(arg_next)}. Then \tcode{PAlloc} @@ -6417,7 +6467,8 @@ \tcode{U} is an unspecified type whose size and alignment are both \tcode{__STDCPP_DEFAULT_NEW_ALIGNMENT__}. -\pnum \mandates +\pnum +\mandates \begin{itemize} \item The first parameter of type \tcode{allocator_arg_t} (if any) is not the last parameter. @@ -6426,14 +6477,16 @@ \item \tcode{allocator_traits::pointer} is a pointer type. \end{itemize} -\pnum \effects Initializes an allocator \tcode{palloc} of type \tcode{PAlloc} +\pnum +\effects Initializes an allocator \tcode{palloc} of type \tcode{PAlloc} with \tcode{alloc}. Uses \tcode{palloc} to allocate storage for the smallest array of \tcode{U} sufficient to provide storage for a coroutine state of size \tcode{size}, and unspecified additional state necessary to ensure that \tcode{operator delete} can later deallocate this memory block with an allocator equal to \tcode{palloc}. -\pnum \returns A pointer to the allocated storage. +\pnum +\returns A pointer to the allocated storage. \end{itemdescr} \begin{itemdecl} @@ -6441,10 +6494,12 @@ \end{itemdecl} \begin{itemdescr} -\pnum \expects \tcode{pointer} was returned from an invocation +\pnum +\expects \tcode{pointer} was returned from an invocation of the above overload of \tcode{operator new} with a size argument equal to \tcode{size}. -\pnum \effects Deallocates the storage pointed to by \tcode{pointer} +\pnum +\effects Deallocates the storage pointed to by \tcode{pointer} using an allocator equal to that used to allocate it. \end{itemdescr} From 1587aa47c0ddfc7b51a68a672987dcb8f2001109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 29 Jun 2025 20:03:09 +0200 Subject: [PATCH 03/56] Fixup: address more issues reported by the CI --- source/exceptions.tex | 2 +- source/exec.tex | 177 ++++++++++++++++++++++++------------------ 2 files changed, 101 insertions(+), 78 deletions(-) diff --git a/source/exceptions.tex b/source/exceptions.tex index de858e4445..c036557223 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -1129,7 +1129,7 @@ whose promise type has an \tcode{unhandled_stopped} member function, or \item% -when an exception is thrown from a coroutine \tcode{std::execution::task}\iref{exec.task} which doesn’t support a \tcode{std::execution::set_error_t(std::execption_ptr)} completion. +when an exception is thrown from a coroutine \tcode{std::execution::task}\iref{exec.task} which doesn't support a \tcode{std::execution::set_error_t(std::execption_ptr)} completion. \end{itemize} diff --git a/source/exec.tex b/source/exec.tex index d2d3f10eed..22ad3b97e3 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5855,7 +5855,8 @@ \begin{itemdescr} \pnum -\effects: Initialize \exposid{sch_} with +\effects +Initialize \exposid{sch_} with \tcode{allocate_shared>(alloc, std::forward(sch))}. @@ -5864,9 +5865,10 @@ allocated memory for small scheduler objects. \pnum -\remarks Any allocations performed by construction of -\exposid{sender} or \exposid{state} objects resulting from calls -on \tcode{*this} are performed using a copy of \tcode{alloc}. +\remarks +Any allocations performed by construction of \exposid{sender} or +\exposid{state} objects resulting from calls on \tcode{*this} are +performed using a copy of \tcode{alloc}. \end{itemdescr} \begin{itemdecl} @@ -5875,8 +5877,9 @@ \begin{itemdescr} \pnum -\effects Returns an object of type \exposid{sender} containing -a sender initialized with \tcode{schedule(SCHED(*this))}. +\effects +Returns an object of type \exposid{sender} containing a sender +initialized with \tcode{schedule(SCHED(*this))}. \end{itemdescr} \begin{itemdecl} @@ -5885,7 +5888,8 @@ \begin{itemdescr} \pnum -\effects Equivalent to: \tcode{return lhs == SCHED(rhs);} +\effects +Equivalent to: \tcode{return lhs == SCHED(rhs);} \end{itemdescr} \begin{itemdecl} @@ -5897,8 +5901,9 @@ \begin{itemdescr} \pnum -\returns \tcode{false} if type of \tcode{SCHED(lhs)} is not -\tcode{Sch}, otherwise \tcode{SCHED(lhs) == rhs;} +\returns +\tcode{false} if type of \tcode{SCHED(lhs)} is not \tcode{Sch}, +otherwise \tcode{SCHED(lhs) == rhs;} \end{itemdescr} \begin{codeblock} @@ -5939,12 +5944,13 @@ \end{itemdecl} \pnum -\effects Let \tcode{r} be an object of a type that models -\libconcept{receiver} and whose completion handlers result in -invoking the corresponding completion handlers of \tcode{rcvr} or -copy thereof. Returns an object of type \tcode{\exposid{state}} -containing an operation state object initialized with -\tcode{connect(SENDER(*this), std::move(r))}. +\effects +Let \tcode{r} be an object of a type that models \libconcept{receiver} +and whose completion handlers result in invoking the corresponding +completion handlers of \tcode{rcvr} or copy thereof. Returns an +object of type \tcode{\exposid{state}} containing an operation +state object initialized with \tcode{connect(SENDER(*this), +std::move(r))}. \begin{codeblock} template @@ -5966,8 +5972,9 @@ \begin{itemdescr} \pnum -\effects Equivalent to \tcode{start(st)} where \tcode{st} is -the operation state object contained by \tcode{*this}. +\effects +Equivalent to \tcode{start(st)} where \tcode{st} is the operation +state object contained by \tcode{*this}. \end{itemdescr} \rSec2[exec.task]{\tcode{execution::task}} @@ -6075,8 +6082,9 @@ \begin{itemdescr} \pnum -\effects Initializes \exposid{handle} with -\tcode{exchange(other.\exposid{handle}, \{\})}. +\effects +Initializes \exposid{handle} with \tcode{exchange(other.\exposid{handle}, +\{\})}. \end{itemdescr} \begin{itemdecl} @@ -6085,7 +6093,8 @@ \begin{itemdescr} \pnum -\effects Equivalent to: +\effects +Equivalent to: \begin{codeblock} if (@\exposid{handle}@) @@ -6100,12 +6109,13 @@ \begin{itemdescr} \pnum -\expects \tcode{bool(\exposid{handle})} is \tcode{true}. +\expects +\tcode{bool(\exposid{handle})} is \tcode{true}. \pnum -\effects Equivalent to: \tcode{return -\exposid{state}(exchange(\exposid{handle}, \{\}), -std::forward(recv));} +\effects +Equivalent to: \tcode{return \exposid{state}(exchange(\exposid{handle}, +\{\}), std::forward(recv));} \end{itemdescr} \rSec3[task.state]{\tcode{Class template \tcode{task::state}}} @@ -6147,7 +6157,8 @@ \begin{itemdescr} \pnum -\effects Initializes +\effects +Initializes \item \exposid{handle} with \tcode{std::move(h)}; \item \exposid{rcvr} with \tcode{std::forward(rr)}; @@ -6167,7 +6178,8 @@ \begin{itemdescr} \pnum -\effects Equivalent to: +\effects +Equivalent to: \begin{codeblock} if (@\exposid{handle}@) @@ -6181,10 +6193,10 @@ \begin{itemdescr} \pnum -\effects Let \tcode{prom} be the object -\tcode{\exposid{handle}.promise()}. Associates -\tcode{STATE(prom)}, \tcode{RCVR(prom)}, -and \tcode{SCHED(prom)} with \tcode{*this} as follows: +\effects +Let \tcode{prom} be the object \tcode{\exposid{handle}.promise()}. +Associates \tcode{STATE(prom)}, \tcode{RCVR(prom)}, and \tcode{SCHED(prom)} +with \tcode{*this} as follows: \begin{itemize} \item \tcode{STATE(prom)} is \tcode{*this}. @@ -6300,11 +6312,13 @@ \begin{itemdescr} \pnum -\mandates The first parameter of type \tcode{allocator_arg_t} (if -any) is not the last parameter. +\mandates +The first parameter of type \tcode{allocator_arg_t} (if any) is not +the last parameter. \pnum -\effects If \tcode{Args} contains an element of type \tcode{allocator_arg_t} +\effects +If \tcode{Args} contains an element of type \tcode{allocator_arg_t} then \exposid{alloc} is initialized with the corresponding next element of \tcode{args}. Otherwise, \exposid{alloc} is initialized with \tcode{allocator_type()}. @@ -6316,8 +6330,9 @@ \begin{itemdescr} \pnum -\returns A \tcode{task} object whose member \exposid{handle} -is \tcode{coroutine_handle::from_promise(*this)}. +\returns +A \tcode{task} object whose member \exposid{handle} is +\tcode{coroutine_handle::from_promise(*this)}. \end{itemdescr} \begin{itemdecl} @@ -6326,8 +6341,9 @@ \begin{itemdescr} \pnum -\returns An awaitable object of unspecified type \iref{expr.await} -whose member functions arrange for +\returns +An awaitable object of unspecified type \iref{expr.await} whose +member functions arrange for \begin{itemize} \item the calling coroutine to be suspended, @@ -6342,9 +6358,10 @@ \begin{itemdescr} \pnum -\returns An awaitable object of unspecified type - \iref{expr.await} whose member functions arrange for the completion - of the asynchronous operation associated with \tcode{STATE(*this)} by invoking: +\returns +An awaitable object of unspecified type \iref{expr.await} whose +member functions arrange for the completion of the asynchronous +operation associated with \tcode{STATE(*this)} by invoking: \begin{itemize} \item @@ -6366,16 +6383,18 @@ \begin{itemdescr} \pnum -\mandates \tcode{std::move(err.error)} is convertible to - exactly one of the \tcode{set_error_t} argument types of \tcode{error_types}. Let \tcode{Cerr} - be that type. +\mandates +\tcode{std::move(err.error)} is convertible to exactly one of the +\tcode{set_error_t} argument types of \tcode{error_types}. Let +\tcode{Cerr} be that type. \pnum -\returns An awaitable object of unspecified type - \iref{expr.await} whose member functions arrange for the calling - coroutine to be suspended and then completes - the asynchronous operation associated with \tcode{STATE(*this)} by invoking - \tcode{set_error(std::move(RCVR(*this)), Cerr(std::move(err.error)))}. +\returns +An awaitable object of unspecified type \iref{expr.await} whose +member functions arrange for the calling coroutine to be suspended +and then completes the asynchronous operation associated with +\tcode{STATE(*this)} by invoking \tcode{set_error(std::move(RCVR(*this)), +Cerr(std::move(err.error)))}. \end{itemdescr} \begin{itemdecl} @@ -6385,10 +6404,11 @@ \begin{itemdescr} \pnum -\returns If \tcode{same_as} is - \tcode{true} returns \tcode{as_awaitable(std::forward (sndr), *this)}; - otherwise returns - \tcode{as_awaitable(affine_on(std::forward(sndr), SCHED(*this)), *this)}. +\returns +If \tcode{same_as} is \tcode{true} +returns \tcode{as_awaitable(std::forward (sndr), *this)}; +otherwise returns \tcode{as_awaitable(affine_on(std::forward(sndr), +SCHED(*this)), *this)}. \end{itemdescr} \begin{itemdecl} @@ -6398,8 +6418,8 @@ \begin{itemdescr} \pnum -\effects Equivalent to: \tcode{returns -await_transform(just(exchange(SCHED(*this), +\effects +Equivalent to: \tcode{returns await_transform(just(exchange(SCHED(*this), scheduler_type (sch.scheduler))), *this);} \end{itemdescr} @@ -6409,10 +6429,10 @@ \begin{itemdescr} \pnum -\effects If the signature \tcode{set_error_t(exception_ptr)} is - not an element of \tcode{error_types}, calls \tcode{terminate()} - \iref{except.terminate}. Otherwise, stores - \tcode{current_exception()} into \exposid{errors}. +\effects +If the signature \tcode{set_error_t(exception_ptr)} is not an element +of \tcode{error_types}, calls \tcode{terminate()} \iref{except.terminate}. +Otherwise, stores \tcode{current_exception()} into \exposid{errors}. \end{itemdescr} \begin{itemdecl} @@ -6421,14 +6441,15 @@ \begin{itemdescr} \pnum -\effects Completes the asynchronous operation - associated with \tcode{STATE(*this)} by invoking - \tcode{set_stopped(std::move(RCVR(*this)))}. +\effects +Completes the asynchronous operation associated with \tcode{STATE(*this)} +by invoking \tcode{set_stopped(std::move(RCVR(*this)))}. \end{itemdescr} \begin{itemdescr} \pnum -\returns \tcode{noop_coroutine()}. +\returns +\tcode{noop_coroutine()}. \end{itemdescr} \begin{itemdecl} @@ -6437,8 +6458,8 @@ \begin{itemdescr} \pnum -\returns An object \tcode{env} - such that queries are forwarded as follows: +\returns +An object \tcode{env} such that queries are forwarded as follows: \begin{itemize} \item \tcode{env.query(get_scheduler)} returns \tcode{scheduler_type(SCHED(*this))}. @@ -6478,15 +6499,16 @@ \end{itemize} \pnum -\effects Initializes an allocator \tcode{palloc} of type \tcode{PAlloc} - with \tcode{alloc}. Uses \tcode{palloc} to allocate storage for the smallest - array of \tcode{U} sufficient to provide storage for a coroutine state - of size \tcode{size}, and unspecified additional state necessary to - ensure that \tcode{operator delete} can later deallocate this memory - block with an allocator equal to \tcode{palloc}. - +\effects +Initializes an allocator \tcode{palloc} of type \tcode{PAlloc} with +\tcode{alloc}. Uses \tcode{palloc} to allocate storage for the +smallest array of \tcode{U} sufficient to provide storage for a +coroutine state of size \tcode{size}, and unspecified additional +state necessary to ensure that \tcode{operator delete} can later +deallocate this memory block with an allocator equal to \tcode{palloc}. \pnum -\returns A pointer to the allocated storage. +\returns +A pointer to the allocated storage. \end{itemdescr} \begin{itemdecl} @@ -6495,11 +6517,12 @@ \begin{itemdescr} \pnum -\expects \tcode{pointer} was returned from an invocation - of the above overload of \tcode{operator new} with a size argument - equal to \tcode{size}. +\expects +\tcode{pointer} was returned from an invocation of the above overload +of \tcode{operator new} with a size argument equal to \tcode{size}. \pnum -\effects Deallocates the storage pointed to by \tcode{pointer} - using an allocator equal to that used to allocate it. +\effects +Deallocates the storage pointed to by \tcode{pointer} using an +allocator equal to that used to allocate it. \end{itemdescr} From 308523f1b42bcf05cc6a359860de65ef315fab0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 29 Jun 2025 23:19:17 +0100 Subject: [PATCH 04/56] Fixup: addressed more CI feedback --- source/exec.tex | 76 ++++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 22ad3b97e3..9f795dd5a6 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5791,8 +5791,8 @@ \tcode{((void)sndr, auto(rcvr))} is potentially-throwing, and \item the expression \tcode{get_completion_scheduler(get_env(sndr))} has -type \tcode{inline_scheduler} and is potentially-throwing if and -only if \tcode{get_env(sndr)} is potentially-throwing. +type\linebreak\tcode{inline_scheduler} and is potentially-throwing % avoid Overfull +if and only if \tcode{get_env(sndr)} is potentially-throwing. \end{itemize} \pnum @@ -5822,8 +5822,8 @@ using scheduler_concept = scheduler_t; template> - requires (!same_as>) - && scheduler + requires (!@\libconcept{same_as}@>) + && @\libconcept{scheduler}@ explicit task_scheduler(Sch&& sch, Allocator alloc = {}); @\exposid{sender}@ schedule(); @@ -5831,8 +5831,8 @@ friend bool operator== (const task_scheduler& lhs, const task_scheduler& rhs) noexcept; template - requires (!same_as) - && scheduler + requires (!@\libconcept{same_as}@) + && @\libconcept{scheduler}@ friend bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; private: @@ -5849,7 +5849,7 @@ \begin{itemdecl} template> - requires(!same_as>) && scheduler + requires(!@\libconcept{same_as}@>) && @\libconcept{scheduler}@ explicit task_scheduler(Sch&& sch, Allocator alloc = {}); \end{itemdecl} @@ -5857,7 +5857,7 @@ \pnum \effects Initialize \exposid{sch_} with -\tcode{allocate_shared>(alloc, +\tcode{allocate_shared>(alloc, \linebreak % avoid Overfull std::forward(sch))}. \pnum @@ -5879,7 +5879,7 @@ \pnum \effects Returns an object of type \exposid{sender} containing a sender -initialized with \tcode{schedule(SCHED(*this))}. +initialized with\linebreak \tcode{schedule(SCHED(*this))}. % avoid Overfull \end{itemdescr} \begin{itemdecl} @@ -5894,8 +5894,8 @@ \begin{itemdecl} template - requires (!same_as) - && scheduler + requires (!@\libconcept{same_as}@) + && @\libconcept{scheduler}@ bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; \end{itemdecl} @@ -5953,7 +5953,7 @@ std::move(r))}. \begin{codeblock} -template +template<@\libconcept{receiver}@ R> class task_scheduler::@\exposid{state}@ { // \expos public: using operation_state_concept = operation_state_t; @@ -5998,7 +5998,7 @@ template class task { // \ref{task.state} - template + template<@\libconcept{receiver}@ Rcvr> class @\exposidnc{state}@; // \expos public: @@ -6016,7 +6016,7 @@ task(task&&) noexcept; ~task(); - template + template<@\libconcept{receiver}@ Rcvr> @\exposid{state}@ connect(Rcvr&& rcvr); private: @@ -6046,7 +6046,7 @@ if that qualified-id is valid and denotes a type, \tcode{inplace_stop_source} otherwise. \item \tcode{error_types} is \tcode{Environment::error_types} if -that qualified-id is valid and denotes a type, +that qualified-id is valid and denotes a type, \linebreak % avoid Overfull \tcode{completion_signatures} otherwise. \end{itemize} @@ -6123,7 +6123,7 @@ \begin{codeblock} namespace std::execution { template - template + template<@\libconcept{receiver}@ Rcvr> class task::@\exposid{state}@ { // \expos public: using operation_state_concept = operation_state_t; @@ -6146,8 +6146,8 @@ \begin{itemdescr} \pnum The type \exposid{own-env-t} is \tcode{Environment::template -env_type()))>} if that qualified-id is -valid and denotes a type, \tcode{env<>} otherwise. +env_type()))>} if that % avoid Overfull +qualified-id is valid and denotes a type, \tcode{env<>} otherwise. \end{itemdescr} \begin{itemdecl} @@ -6212,14 +6212,19 @@ \tcode{prom.\exposid{source}} such that \begin{itemize} -\item \tcode{prom.\exposid{token}.stop_requested()} returns +\item +\tcode{prom.\exposid{token}.stop_requested()} returns \tcode{st.stop_requested()}; -\item \tcode{prom.\exposid{token}.stop_possible()} returns +\item +\tcode{prom.\exposid{token}.stop_possible()} returns \tcode{st.stop_possible()}; and -\item for types \tcode{Fn} and \tcode{Init} such that both -\tcode{invocable} and \tcode{constructible_from} are -modeled, \tcode{stop_token_type::callback_type} models -\tcode{\exposid{stoppable-callback-for}}. +\item +for types \tcode{Fn} and \tcode{Init} such that both +\tcode{\libconcept{invocable}} and +\tcode{\libconcept{constructible_from}} are modeled, +\tcode{stop_token_type::callback_type} models +\tcode{\exposid{stoppable-callback-for}}. \end{itemize} After that invokes \tcode{\exposid{handle}.resume()}. @@ -6332,7 +6337,7 @@ \pnum \returns A \tcode{task} object whose member \exposid{handle} is -\tcode{coroutine_handle::from_promise(*this)}. +\tcode{coroutine_handle::\linebreak from_promise(*this)}. % avoid Overfull \end{itemdescr} \begin{itemdecl} @@ -6406,8 +6411,9 @@ \pnum \returns If \tcode{same_as} is \tcode{true} -returns \tcode{as_awaitable(std::forward (sndr), *this)}; -otherwise returns \tcode{as_awaitable(affine_on(std::forward(sndr), +returns \tcode{as_awaitable(\linebreak std::forward (sndr), % avoid Overfull +*this)}; otherwise returns +\tcode{as_awaitable(affine_on(\linebreak std::forward(sndr), % avoid Overfull SCHED(*this)), *this)}. \end{itemdescr} @@ -6420,7 +6426,7 @@ \pnum \effects Equivalent to: \tcode{returns await_transform(just(exchange(SCHED(*this), -scheduler_type (sch.scheduler))), *this);} +\linebreak scheduler_type(sch.scheduler))), *this);} % avoid Overfull \end{itemdescr} \begin{itemdecl} @@ -6480,13 +6486,13 @@ \begin{itemdescr} \pnum -If there is no parameter with type \tcode{allocator_arg_t} - then let \tcode{alloc} be \tcode{Allocator()}. Let \tcode{arg_next} be the - parameter following the first \tcode{allocator_arg_t} parameter (if - any) and let \tcode{alloc} be \tcode{Allocator(arg_next)}. Then \tcode{PAlloc} - is \tcode{allocator_traits::template rebind_alloc} where - \tcode{U} is an unspecified type whose size and alignment are both - \tcode{__STDCPP_DEFAULT_NEW_ALIGNMENT__}. +If there is no parameter with type \tcode{allocator_arg_t} then let +\tcode{alloc} be \tcode{Allocator()}. Let \tcode{arg_next} be the +parameter following the first \tcode{allocator_arg_t} parameter (if +any) and let \tcode{alloc} be \tcode{Allocator(arg_next)}. Then +\tcode{PAlloc} is \tcode{allocator_traits::template +rebind_alloc\linebreak} where \tcode{U} is an unspecified type % avoid Overfull +whose size and alignment are both \tcode{__STDCPP_DEFAULT_NEW_ALIGNMENT__}. \pnum \mandates From 123ff25f8253532e7c6dd0ff789fd0c590fe871d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 29 Jun 2025 23:31:17 +0100 Subject: [PATCH 05/56] Fixup: address more CI feedback The CI objected to use of \exposid{sender} => renamed sender to ts-sender. This change should be editorial but is more invovled --- source/exec.tex | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 9f795dd5a6..5c317565d3 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5814,7 +5814,7 @@ \begin{codeblock} namespace std::execution { class task_scheduler { - class @\exposidnc{sender}@; // \expos + class @\exposidnc{ts-sender}@; // \expos template<@\libconcept{receiver}@ R> class @\exposidnc{state}@; // \expos @@ -5826,7 +5826,7 @@ && @\libconcept{scheduler}@ explicit task_scheduler(Sch&& sch, Allocator alloc = {}); - @\exposid{sender}@ schedule(); + @\exposid{ts-sender}@ schedule(); friend bool operator== (const task_scheduler& lhs, const task_scheduler& rhs) noexcept; @@ -5866,19 +5866,19 @@ \pnum \remarks -Any allocations performed by construction of \exposid{sender} or +Any allocations performed by construction of \exposid{ts-sender} or \exposid{state} objects resulting from calls on \tcode{*this} are performed using a copy of \tcode{alloc}. \end{itemdescr} \begin{itemdecl} -@\exposid{sender}@ schedule(); +@\exposid{ts-sender}@ schedule(); \end{itemdecl} \begin{itemdescr} \pnum \effects -Returns an object of type \exposid{sender} containing a sender +Returns an object of type \exposid{ts-sender} containing a sender initialized with\linebreak \tcode{schedule(SCHED(*this))}. % avoid Overfull \end{itemdescr} @@ -5907,7 +5907,7 @@ \end{itemdescr} \begin{codeblock} -class task_scheduler::@\exposid{sender}@ { // \expos +class task_scheduler::@\exposid{ts-sender}@ { // \expos public: using sender_concept = sender_t; @@ -5917,9 +5917,9 @@ \end{codeblock} \pnum -\exposid{sender} is an exposition-only class that models +\exposid{ts-sender} is an exposition-only class that models \libconcept{sender}\iref{exec.snd} and for which -\tcode{completion_signatures_of_t<\exposid{sender}>} denotes: +\tcode{completion_signatures_of_t<\exposid{ts-sender}>} denotes: \begin{codeblock} completion_signatures< @@ -5931,7 +5931,7 @@ \pnum Let \tcode{sch} be an object of type \tcode{task_scheduler} -and let \tcode{sndr} be an object of type \exposid{sender} obtained +and let \tcode{sndr} be an object of type \exposid{ts-sender} obtained from \tcode{schedule(sch)}. Then \tcode{get_completion_scheduler(get_env(sndr)) == sch} is \tcode{true}. The object \tcode{SENDER(sndr)} is the sender From af0f16f190fc899000e8fb787e642e94980b0fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 29 Jun 2025 23:49:52 +0100 Subject: [PATCH 06/56] Fixup: addressed more CI feedback (on referencing Cpp17Allocator) --- source/exec.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 5c317565d3..d05a6ca414 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6071,8 +6071,8 @@ \end{itemize} \pnum -\tcode{allocator_type} shall meet the \libconcept{Cpp17Allocator} -requirements. +\tcode{allocator_type} shall meet the \oldconcept{Allocator} +requirements\iref{allocator.requirements.general}. \rSec3[task.members]{\tcode{task} Members} From 3e4f22f9cc2160c10bdd23cfe8bc6096a4ee834e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:07:30 +0100 Subject: [PATCH 07/56] fixup: added newline in front of \pnum Co-authored-by: Jan Schultke --- source/exec.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/exec.tex b/source/exec.tex index d05a6ca414..a47b7b2472 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6512,6 +6512,7 @@ coroutine state of size \tcode{size}, and unspecified additional state necessary to ensure that \tcode{operator delete} can later deallocate this memory block with an allocator equal to \tcode{palloc}. + \pnum \returns A pointer to the allocated storage. From 40780b103bdf261238d358b3bb42aa9a0f3bca5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:08:53 +0100 Subject: [PATCH 08/56] fixup: use \brk{} to avoid overfull hbox and remove comment Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index a47b7b2472..147ec77968 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6491,7 +6491,7 @@ parameter following the first \tcode{allocator_arg_t} parameter (if any) and let \tcode{alloc} be \tcode{Allocator(arg_next)}. Then \tcode{PAlloc} is \tcode{allocator_traits::template -rebind_alloc\linebreak} where \tcode{U} is an unspecified type % avoid Overfull +re\-bind_alloc\brk{}} where \tcode{U} is an unspecified type whose size and alignment are both \tcode{__STDCPP_DEFAULT_NEW_ALIGNMENT__}. \pnum From ad22cdaec85b27926c13ce8010f39e0f9d6d5c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:09:38 +0100 Subject: [PATCH 09/56] fixup: remove space before \iref Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 147ec77968..5b6a0d5718 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6437,7 +6437,7 @@ \pnum \effects If the signature \tcode{set_error_t(exception_ptr)} is not an element -of \tcode{error_types}, calls \tcode{terminate()} \iref{except.terminate}. +of \tcode{error_types}, calls \tcode{terminate()}\iref{except.terminate}. Otherwise, stores \tcode{current_exception()} into \exposid{errors}. \end{itemdescr} From 0122d6398a1bfc7de169fceb7135aabda60471c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:11:00 +0100 Subject: [PATCH 10/56] fixup: fix return[s] spelling and use codeblock to avoid overfull hbox Co-authored-by: Jan Schultke --- source/exec.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 5b6a0d5718..1b1e19bfdf 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6425,8 +6425,10 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{returns await_transform(just(exchange(SCHED(*this), -\linebreak scheduler_type(sch.scheduler))), *this);} % avoid Overfull +Equivalent to: +\begin{codeblock} +return await_transform(just(exchange(SCHED(*this), scheduler_type(sch.scheduler))), *this); +\end{codeblock} \end{itemdescr} \begin{itemdecl} From 39339587465604bc3d63248e9f6f2a5ced7ffdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:11:44 +0100 Subject: [PATCH 11/56] fixup: use \brk{} to avoid overfull hbox and remove comment Co-authored-by: Jan Schultke --- source/exec.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 1b1e19bfdf..8edb970e34 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6413,8 +6413,7 @@ If \tcode{same_as} is \tcode{true} returns \tcode{as_awaitable(\linebreak std::forward (sndr), % avoid Overfull *this)}; otherwise returns -\tcode{as_awaitable(affine_on(\linebreak std::forward(sndr), % avoid Overfull -SCHED(*this)), *this)}. +\tcode{as_awaitable(affine_on(\brk{}std::forward(sndr), \exposid{SCHED}(*this)), *this)}. \end{itemdescr} \begin{itemdecl} From 81c6b90e56a18582279117b3da60189327a89654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:12:35 +0100 Subject: [PATCH 12/56] fixup: add missing \tcode for boolean value Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 8edb970e34..53902c9fb7 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5780,7 +5780,7 @@ \pnum Let \tcode{sndr} be an expression of type \exposid{inline-sender}, let \tcode{rcvr} be an expression such that -\tcode{\libconcept{receiver_of}} is {true} +\tcode{\libconcept{receiver_of}} is \tcode{true} where \tcode{CS} is \tcode{completion_signatures}, then: From 3a1ce2342996f6f560dccab97b069844f56c8df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:14:42 +0100 Subject: [PATCH 13/56] fixup: fix speclling of exception_ptr and split the line Co-authored-by: Jan Schultke --- source/exceptions.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/exceptions.tex b/source/exceptions.tex index c036557223..11769f3f2b 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -1129,7 +1129,8 @@ whose promise type has an \tcode{unhandled_stopped} member function, or \item% -when an exception is thrown from a coroutine \tcode{std::execution::task}\iref{exec.task} which doesn't support a \tcode{std::execution::set_error_t(std::execption_ptr)} completion. +when an exception is thrown from a coroutine \tcode{std::execution::task}\iref{exec.task} +which doesn't support a \tcode{std::execution::set_error_t(std::exception_ptr)} completion. \end{itemize} From 1257b056990d1df55eddbce454b38538f7128d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:18:41 +0100 Subject: [PATCH 14/56] fixup: add space before colon for base class declaration Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 53902c9fb7..ba5d4a6fbc 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5721,7 +5721,7 @@ \begin{codeblock} namespace std::execution { template<> - struct @\exposid{impls-for}@: @\exposid{default-impls}@ { + struct @\exposid{impls-for}@ : @\exposid{default-impls}@ { static constexpr auto @\exposid{get-attrs}@ = [](const auto& data, const auto& child) noexcept -> decltype(auto) { return @\exposid{JOIN-ENV}@(@\exposid{SCHED-ATTRS}@(data), @\exposid{FWD-ENV}@(get_env(child))); From e8886757b14b3101bb3339c37624b2ec72d843f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:19:42 +0100 Subject: [PATCH 15/56] fixup: add missing \libconcept Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index ba5d4a6fbc..3c616f07a7 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5735,7 +5735,7 @@ returned from \tcode{affine_on(sndr, sch)} or one equal to such, and let \tcode{OutSndr} be the type \tcode{decltype((out_sndr))}. Let \tcode{out_rcvr} be a subexpression denoting a receiver that -has an environment of type \tcode{Env} such that \tcode{sender_in} +has an environment of type \tcode{Env} such that \tcode{\libconcept{sender_in}} is \tcode{true}. Let \tcode{op} be an lvalue referring to the operation state that results from connecting \tcode{out_sndr} to \tcode{out_rcvr}. Calling \tcode{start(op)} will start \tcode{sndr} From 9ae1bd2034b8dc6d0c8d7166ef418dcdfa8edb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:20:39 +0100 Subject: [PATCH 16/56] fixup: add missing space after == Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 3c616f07a7..75d0bbe082 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5761,7 +5761,7 @@ using scheduler_concept = scheduler_t; constexpr @\exposid{inline-sender}@ schedule() noexcept { return {}; } - constexpr bool operator== (const inline_scheduler&) const noexcept = default; + constexpr bool operator==(const inline_scheduler&) const noexcept = default; }; } \end{codeblock} From b830f0765e5862abf4b23e98949afe7891382fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:24:23 +0100 Subject: [PATCH 17/56] fixup: apply proper indentation Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 75d0bbe082..975c8cedba 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5816,7 +5816,7 @@ class task_scheduler { class @\exposidnc{ts-sender}@; // \expos template<@\libconcept{receiver}@ R> - class @\exposidnc{state}@; // \expos + class @\exposidnc{state}@; // \expos public: using scheduler_concept = scheduler_t; From 7312298e140d8f30cc1c198bbd63904fc19a91c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:25:32 +0100 Subject: [PATCH 18/56] fixup: added missing space after == Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 975c8cedba..4e549ec4c4 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5833,7 +5833,7 @@ template requires (!@\libconcept{same_as}@) && @\libconcept{scheduler}@ - friend bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; + friend bool operator==(const task_scheduler& lhs, const Sch& rhs) noexcept; private: shared_ptr @\exposidnc{sch_}@; // \expos From 8626f617484f95a7a8a18055159618674aee9455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:27:56 +0100 Subject: [PATCH 19/56] fixup: remove extraneous space after == Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 4e549ec4c4..810e7f61f6 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5828,7 +5828,7 @@ @\exposid{ts-sender}@ schedule(); - friend bool operator== (const task_scheduler& lhs, const task_scheduler& rhs) + friend bool operator==(const task_scheduler& lhs, const task_scheduler& rhs) noexcept; template requires (!@\libconcept{same_as}@) From 85248dd85bd177fab5b76b224f6d76f442066ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:29:45 +0100 Subject: [PATCH 20/56] fixup: use \brk{} to deal with overfull hbox Co-authored-by: Jan Schultke --- source/exec.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 810e7f61f6..95f9cabe4a 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5857,8 +5857,7 @@ \pnum \effects Initialize \exposid{sch_} with -\tcode{allocate_shared>(alloc, \linebreak % avoid Overfull -std::forward(sch))}. +\tcode{allocate_shared>(alloc,\brk{} std::forward(sch))}. \pnum \recommended Implementations should avoid the use of dynamically From 6f037dfe890569086e78ec849390f014705e8894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:31:41 +0100 Subject: [PATCH 21/56] fixup: move text after \recommended to a new line Co-authored-by: Jan Schultke --- source/exec.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 95f9cabe4a..07c218b90e 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5860,7 +5860,8 @@ \tcode{allocate_shared>(alloc,\brk{} std::forward(sch))}. \pnum -\recommended Implementations should avoid the use of dynamically +\recommended +Implementations should avoid the use of dynamically allocated memory for small scheduler objects. \pnum From 0c5e0e0f5ee22f588bb2cd0e0ba504161eb611c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:32:56 +0100 Subject: [PATCH 22/56] fixup: use \brk{} to deal with overfull hbox Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 07c218b90e..193f438f2e 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5879,7 +5879,7 @@ \pnum \effects Returns an object of type \exposid{ts-sender} containing a sender -initialized with\linebreak \tcode{schedule(SCHED(*this))}. % avoid Overfull +initialized with \tcode{sched\-ule(\brk{}\exposid{SCHED}(*this))}. \end{itemdescr} \begin{itemdecl} From 6cd965a5caa50c551abf0bbc5314406155be6f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:33:46 +0100 Subject: [PATCH 23/56] fixup: remove extraneous space after == Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 193f438f2e..5b9325aee2 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5883,7 +5883,7 @@ \end{itemdescr} \begin{itemdecl} -bool operator== (const task_scheduler& lhs, const task_scheduler& rhs) noexcept; +bool operator==(const task_scheduler& lhs, const task_scheduler& rhs) noexcept; \end{itemdecl} \begin{itemdescr} From 7d8d54c28212d13feab7f19931221d4efa3d53fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:35:02 +0100 Subject: [PATCH 24/56] fixup: remove extraneous space after == Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 5b9325aee2..77a737b72b 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5896,7 +5896,7 @@ template requires (!@\libconcept{same_as}@) && @\libconcept{scheduler}@ -bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; +bool operator==(const task_scheduler& lhs, const Sch& rhs) noexcept; \end{itemdecl} \begin{itemdescr} From 0f0b1655808d07dc1843115919598c9a0d7e9a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:36:11 +0100 Subject: [PATCH 25/56] fixup: use proper indentation after template. Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 77a737b72b..3219a3feff 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5912,7 +5912,7 @@ using sender_concept = sender_t; template<@\libconcept{receiver}@ Rcvr> - @\exposid{state}@ connect(Rcvr&& rcvr); + @\exposid{state}@ connect(Rcvr&& rcvr); }; \end{codeblock} From d0d267e50ff3f4ca797f8214bc2c57735fe9f08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:37:31 +0100 Subject: [PATCH 26/56] fixup: use proper indentation after template head Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 3219a3feff..75ce68c02c 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5940,7 +5940,7 @@ \begin{itemdecl} template<@\libconcept{receiver}@ Rcvr> -@\exposid{state}@ connect(Rcvr&& rcvr); + @\exposid{state}@ connect(Rcvr&& rcvr); \end{itemdecl} \pnum From e92c689ec378e1a99291168d5066b1f68cf9b762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:38:31 +0100 Subject: [PATCH 27/56] fixup: use proper indentation after template header Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 75ce68c02c..f9713b6d5a 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5999,7 +5999,7 @@ class task { // \ref{task.state} template<@\libconcept{receiver}@ Rcvr> - class @\exposidnc{state}@; // \expos + class @\exposidnc{state}@; // \expos public: using sender_concept = sender_t; From c9997fad1c9c086ec758e2ec57aee1d2635c40b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:40:40 +0100 Subject: [PATCH 28/56] fxup: add proper indentation after template head Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index f9713b6d5a..a884a2fec3 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6017,7 +6017,7 @@ ~task(); template<@\libconcept{receiver}@ Rcvr> - @\exposid{state}@ connect(Rcvr&& rcvr); + @\exposid{state}@ connect(Rcvr&& rcvr); private: coroutine_handle @\exposidnc{handle}@; // \expos From e4081d72b4c352bca0ce63c35d96ed1dbe2e8a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:41:34 +0100 Subject: [PATCH 29/56] fixup: grammer: "an" -> "a" Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index a884a2fec3..dfa4a86e0a 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6027,7 +6027,7 @@ \pnum \tcode{task} models \libconcept{sender}\iref{exec.snd} -if \tcode{T} is \tcode{void}, a reference type, or an \cv{}-unqualified +if \tcode{T} is \tcode{void}, a reference type, or a \cv{}-unqualified non-array object type and \tcode{E} is a class type. Otherwise a program that instantiates the definition of \tcode{task} is ill-formed. From dc25ed72ccf52fc37f8130fb0580a52e9e0dee42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:43:09 +0100 Subject: [PATCH 30/56] fixup: user soft-hyphens to deal with overfull hbox Co-authored-by: Jan Schultke --- source/exec.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index dfa4a86e0a..58bdc9d768 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6046,8 +6046,8 @@ if that qualified-id is valid and denotes a type, \tcode{inplace_stop_source} otherwise. \item \tcode{error_types} is \tcode{Environment::error_types} if -that qualified-id is valid and denotes a type, \linebreak % avoid Overfull -\tcode{completion_signatures} otherwise. +that qualified-id is valid and denotes a type, +\tcode{com\-pletion_sign\-atures} otherwise. \end{itemize} \pnum From 939c801a868bf081618401c77a066ca0096d6e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:44:39 +0100 Subject: [PATCH 31/56] fixup: add indentation after template head Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 58bdc9d768..b3826de556 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6104,7 +6104,7 @@ \begin{itemdecl} template<@\libconcept{receiver}@ R> -@\exposid{state}@ connect(R&& recv); + @\exposid{state}@ connect(R&& recv); \end{itemdecl} \begin{itemdescr} From 62284d021d4477c0b98a4ac1d7b8fd0e23ad443e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:45:38 +0100 Subject: [PATCH 32/56] fixup: add indentation after template head Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index b3826de556..534f02891d 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6129,7 +6129,7 @@ using operation_state_concept = operation_state_t; template - @\exposid{state}@(coroutine_handle h, R&& rr); + @\exposid{state}@(coroutine_handle h, R&& rr); ~@\exposid{state}@(); void start() & noexcept; From 1838843531ebe69dc02b9671bfec324b314a94d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:46:29 +0100 Subject: [PATCH 33/56] fixup: use \brk{} to deal with overfull hbox Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 534f02891d..8ece7d7be7 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6146,7 +6146,7 @@ \begin{itemdescr} \pnum The type \exposid{own-env-t} is \tcode{Environment::template -env_type()))>} if that % avoid Overfull +env_type()))>} if that qualified-id is valid and denotes a type, \tcode{env<>} otherwise. \end{itemdescr} From b8e29b81c73277422d980f2d1543dfdec5d4a4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:47:39 +0100 Subject: [PATCH 34/56] fixup: use indentation after template head Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 8ece7d7be7..d243f28c03 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6152,7 +6152,7 @@ \begin{itemdecl} template -@\exposid{state}@(coroutine_handle h, R&& rr); + @\exposid{state}@(coroutine_handle h, R&& rr); \end{itemdecl} \begin{itemdescr} From 0c9a37fd57d3a2e092dd8979e630b6dc38fb9d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:49:41 +0100 Subject: [PATCH 35/56] fixup: use \brk{} for overfull hbox Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index d243f28c03..360e5248e1 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6223,7 +6223,7 @@ \tcode{\libconcept{invocable}} and \tcode{\libconcept{constructible_from}} are modeled, \tcode{stop_token_type::callback_type} models -\tcode{\exposid{stoppable-callback-for}}. Init>}. \end{itemize} From d7a175e0a00f24dbac65dddb95e37e89819115d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:51:46 +0100 Subject: [PATCH 36/56] fixup: fix indentation/alignment Co-authored-by: Jan Schultke --- source/exec.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 360e5248e1..aa7cc0b166 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6264,9 +6264,9 @@ void uncaught_exception(); coroutine_handle<> unhandled_stopped(); - void return_void(); // present only if is_void_v is true; + void return_void(); // present only if \tcode{is_void_v} is \tcode{true}; template - void return_value(V&& value); // present only if is_void_v is false; + void return_value(V&& value); // present only if \tcode{is_void_v} is \tcode{false}; template @\unspec@ yield_value(with_error error); From 947563055901d1c17d75edac6af4af0741581cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:53:35 +0100 Subject: [PATCH 37/56] fixup: use \tcode in code comment Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index aa7cc0b166..2f469bb657 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6289,7 +6289,7 @@ allocator_type @\exposidnc{alloc}@; // \expos stop_source_type @\exposidnc{source}@; // \expos stop_token_type @\exposidnc{token}@; // \expos - optional @\exposidnc{result}@; // \expos; present only if is_void_v is false; + optional @\exposidnc{result}@; // \expos; present only if \tcode{is_void_v} is \tcode{false}; @\exposid{error-variant}@ @\exposidnc{errors}@; // \expos }; } From 9ff1966c9a8f17ba4817837f44734c33f65f116a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:55:09 +0100 Subject: [PATCH 38/56] fixup: use \brk{} to deal with overfull hbox Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 2f469bb657..3d571144ec 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6337,7 +6337,7 @@ \pnum \returns A \tcode{task} object whose member \exposid{handle} is -\tcode{coroutine_handle::\linebreak from_promise(*this)}. % avoid Overfull +\tcode{coroutine_handle::\brk{}from_promise(*this)}. \end{itemdescr} \begin{itemdecl} From fc800870b470f3089ad9cb199c99b8844c49bb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:56:27 +0100 Subject: [PATCH 39/56] fixup: remove space before \iref Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 3d571144ec..f5aeadb4ce 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6347,7 +6347,7 @@ \begin{itemdescr} \pnum \returns -An awaitable object of unspecified type \iref{expr.await} whose +An awaitable object of unspecified type\iref{expr.await} whose member functions arrange for \begin{itemize} From 257a5f29a75cc50d318bbdbba5c0ba4018af0eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:58:09 +0100 Subject: [PATCH 40/56] fixup: use \brk{} to deal with overfull hbox Co-authored-by: Jan Schultke --- source/exec.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index f5aeadb4ce..3dfa648979 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6411,8 +6411,8 @@ \pnum \returns If \tcode{same_as} is \tcode{true} -returns \tcode{as_awaitable(\linebreak std::forward (sndr), % avoid Overfull -*this)}; otherwise returns +returns \tcode{as_awaitable(\brk{}std::forward(sndr), *this)}; +otherwise returns \tcode{as_awaitable(affine_on(\brk{}std::forward(sndr), \exposid{SCHED}(*this)), *this)}. \end{itemdescr} From 2505ad1c90ec15464dce319771304663914f5de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 19:59:25 +0100 Subject: [PATCH 41/56] fixup: remove space before \iref Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 3dfa648979..72b9e95857 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6395,7 +6395,7 @@ \pnum \returns -An awaitable object of unspecified type \iref{expr.await} whose +An awaitable object of unspecified type\iref{expr.await} whose member functions arrange for the calling coroutine to be suspended and then completes the asynchronous operation associated with \tcode{STATE(*this)} by invoking \tcode{set_error(std::move(RCVR(*this)), From 8de0f060954507eb98ae1bcc9eba566dc90d8988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 20:03:01 +0100 Subject: [PATCH 42/56] fixup: use \libconcept Co-authored-by: Jan Schultke --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 72b9e95857..2341a1e1d2 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6410,7 +6410,7 @@ \begin{itemdescr} \pnum \returns -If \tcode{same_as} is \tcode{true} +If \tcode{@\libconcept{same_as}@} is \tcode{true} returns \tcode{as_awaitable(\brk{}std::forward(sndr), *this)}; otherwise returns \tcode{as_awaitable(affine_on(\brk{}std::forward(sndr), \exposid{SCHED}(*this)), *this)}. From 58ba62f276e1a4bd8291eec2ac10cdddc30c3391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 21:25:14 +0200 Subject: [PATCH 43/56] fixup: continue on new line after period --- source/exec.tex | 117 +++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 55 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 2341a1e1d2..6f1ce4e5f1 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5695,16 +5695,17 @@ \pnum \tcode{affine_on} adapts a sender into one that completes on -the specified scheduler. If the algorithm determines that the adapted -sender already completes on the correct scheduler it can avoid any -scheduling operation. +the specified scheduler. +If the algorithm determines that the adapted sender already completes +on the correct scheduler it can avoid any scheduling operation. \pnum The name \tcode{affine_on} denotes a pipeable sender adaptor -object. For subexpressions \tcode{sch} and \tcode{sndr}, if -\tcode{decltype((sch))} does not satisfy \libconcept{scheduler}, or -\tcode{decltype((sndr))} does not satisfy \libconcept{sender}, -\tcode{affine_on(sndr, sch)} is ill-formed. +object. +For subexpressions \tcode{sch} and \tcode{sndr}, if \tcode{decltype((sch))} +does not satisfy \libconcept{scheduler}, or \tcode{decltype((sndr))} +does not satisfy \libconcept{sender}, \tcode{affine_on(sndr, sch)} +is ill-formed. \pnum Otherwise, the expression \tcode{affine_on(sndr, sch)} is @@ -5736,17 +5737,19 @@ and let \tcode{OutSndr} be the type \tcode{decltype((out_sndr))}. Let \tcode{out_rcvr} be a subexpression denoting a receiver that has an environment of type \tcode{Env} such that \tcode{\libconcept{sender_in}} -is \tcode{true}. Let \tcode{op} be an lvalue referring to -the operation state that results from connecting \tcode{out_sndr} -to \tcode{out_rcvr}. Calling \tcode{start(op)} will start \tcode{sndr} -on the current execution agent and execute completion operations -on \tcode{out_rcvr} on an execution agent of the execution resource -associated with \tcode{sch}. If the current execution resource is -the same as the execution resource associated with \tcode{sch}, the -completion operation on \tcode{out_rcvr} may be called before -\tcode{start(op)} completes. If scheduling onto \tcode{sch} fails, -an error completion on \tcode{out_rcvr} shall be executed on an -unspecified execution agent. +is \tcode{true}. +Let \tcode{op} be an lvalue referring to the operation state that +results from connecting \tcode{out_sndr} to \tcode{out_rcvr}. +Calling \tcode{start(op)} will start \tcode{sndr} on the current +execution agent and execute completion operations on \tcode{out_rcvr} +on an execution agent of the execution resource associated with +\tcode{sch}. +If the current execution resource is the same as the execution +resource associated with \tcode{sch}, the completion operation on +\tcode{out_rcvr} may be called before \tcode{start(op)} completes. +If scheduling onto \tcode{sch} fails, an error completion on +\tcode{out_rcvr} shall be executed on an unspecified execution +agent. \rSec2[exec.inline.scheduler]{\tcode{execution::inline_scheduler}} @@ -5768,13 +5771,13 @@ \pnum \tcode{inline_scheduler} is a class that models -\libconcept{scheduler}\iref{exec.sched}. All objects of type -\tcode{inline_scheduler} are equal. +\libconcept{scheduler}\iref{exec.sched}. +All objects of type \tcode{inline_scheduler} are equal. \pnum \exposid{inline-sender} is an exposition-only type that satisfies -\libconcept{sender}. The type -\tcode{completion_signatures_of_t<\exposid{inline-sender}>} +\libconcept{sender}. +he type \tcode{completion_signatures_of_t<\exposid{inline-sender}>} is \tcode{completion_signatures}. \pnum @@ -5843,9 +5846,9 @@ \pnum \tcode{task_scheduler} is a class that models -\libconcept{scheduler}\iref{exec.sched}. Given on object \tcode{s} -of type \tcode{task_scheduler}, let \tcode{SCHED(s)} be the object -owned by \tcode{s.\exposid{sch_}}. +\libconcept{scheduler}\iref{exec.sched}. +Given on object \tcode{s} of type \tcode{task_scheduler}, let +\tcode{SCHED(s)} be the object owned by \tcode{s.\exposid{sch_}}. \begin{itemdecl} template> @@ -5932,11 +5935,11 @@ \pnum Let \tcode{sch} be an object of type \tcode{task_scheduler} and let \tcode{sndr} be an object of type \exposid{ts-sender} obtained -from \tcode{schedule(sch)}. Then -\tcode{get_completion_scheduler(get_env(sndr)) == sch} -is \tcode{true}. The object \tcode{SENDER(sndr)} is the sender -object contained by \tcode{sndr} or an object move constructed from -it. +from \tcode{schedule(sch)}. +Then \tcode{get_completion_scheduler(get_env(sndr)) == sch} +is \tcode{true}. +The object \tcode{SENDER(sndr)} is the sender object contained by +\tcode{sndr} or an object move constructed from it. \begin{itemdecl} template<@\libconcept{receiver}@ Rcvr> @@ -5947,9 +5950,9 @@ \effects Let \tcode{r} be an object of a type that models \libconcept{receiver} and whose completion handlers result in invoking the corresponding -completion handlers of \tcode{rcvr} or copy thereof. Returns an -object of type \tcode{\exposid{state}} containing an operation -state object initialized with \tcode{connect(SENDER(*this), +completion handlers of \tcode{rcvr} or copy thereof. +Returns an object of type \tcode{\exposid{state}} containing +an operation state object initialized with \tcode{connect(SENDER(*this), std::move(r))}. \begin{codeblock} @@ -5983,13 +5986,14 @@ \pnum The \tcode{task} class template represents a sender that can -be used as the return type of coroutines. The first template parameter -\tcode{T} defines the type of the value completion datum -\iref{exec.async.ops} if \tcode{T} is not \tcode{void}. Otherwise, -there are no value completion datums. Inside coroutines returning -\tcode{task} the operand of \tcode{co_return} (if any) becomes -the argument of \tcode{set_value}. The second template parameter -\tcode{Environment} is used to customize the behavior of \tcode{task}. +be used as the return type of coroutines. +The first template parameter \tcode{T} defines the type of the value +completion datum \iref{exec.async.ops} if \tcode{T} is not \tcode{void}. +Otherwise, there are no value completion datums. +Inside coroutines returning \tcode{task} the operand of +\tcode{co_return} (if any) becomes the argument of \tcode{set_value}. +The second template parameter \tcode{Environment} is used to customize +the behavior of \tcode{task}. \rSec3[task.class]{Class template \tcode{task}} @@ -6028,8 +6032,9 @@ \pnum \tcode{task} models \libconcept{sender}\iref{exec.snd} if \tcode{T} is \tcode{void}, a reference type, or a \cv{}-unqualified -non-array object type and \tcode{E} is a class type. Otherwise a program -that instantiates the definition of \tcode{task} is ill-formed. +non-array object type and \tcode{E} is a class type. +Otherwise a program that instantiates the definition of \tcode{task} +is ill-formed. \pnum The nested types of \tcode{task} template specializations @@ -6297,8 +6302,8 @@ \pnum Let \tcode{prom} be an object of \tcode{promise_type} and let \tcode{tsk} be -the \tcode{task} object created by \tcode{prom.get_return_object()}. The -description below refers to objects \tcode{STATE(prom)}, +the \tcode{task} object created by \tcode{prom.get_return_object()}. +The description below refers to objects \tcode{STATE(prom)}, \tcode{RCVR(prom)}, and \tcode{SCHED(prom)} associated with \tcode{tsk} during evalutation of \tcode{task::\exposid{state}::start} for some receiver \tcode{Rcvr}. @@ -6325,8 +6330,8 @@ \effects If \tcode{Args} contains an element of type \tcode{allocator_arg_t} then \exposid{alloc} is initialized with the corresponding next -element of \tcode{args}. Otherwise, \exposid{alloc} is initialized -with \tcode{allocator_type()}. +element of \tcode{args}. +Otherwise, \exposid{alloc} is initialized with \tcode{allocator_type()}. \end{itemdescr} \begin{itemdecl} @@ -6390,8 +6395,8 @@ \pnum \mandates \tcode{std::move(err.error)} is convertible to exactly one of the -\tcode{set_error_t} argument types of \tcode{error_types}. Let -\tcode{Cerr} be that type. +\tcode{set_error_t} argument types of \tcode{error_types}. +Let \tcode{Cerr} be that type. \pnum \returns @@ -6475,8 +6480,8 @@ \item For any other query \tcode{q} and arguments \tcode{a...} a call to \tcode{env.query(q, a...)} returns \tcode{STATE(*this).} \tcode{environment.query(q, a...)} if this expression - is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}. Otherwise - \tcode{env.query(q, a...)} is ill-formed. + is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}. + Otherwise \tcode{env.query(q, a...)} is ill-formed. \end{itemize} \end{itemdescr} @@ -6488,10 +6493,11 @@ \begin{itemdescr} \pnum If there is no parameter with type \tcode{allocator_arg_t} then let -\tcode{alloc} be \tcode{Allocator()}. Let \tcode{arg_next} be the -parameter following the first \tcode{allocator_arg_t} parameter (if -any) and let \tcode{alloc} be \tcode{Allocator(arg_next)}. Then -\tcode{PAlloc} is \tcode{allocator_traits::template +\tcode{alloc} be \tcode{Allocator()}. +Let \tcode{arg_next} be the parameter following the first +\tcode{allocator_arg_t} parameter (if any) and let \tcode{alloc} +be \tcode{Allocator(arg_next)}. +Then \tcode{PAlloc} is \tcode{allocator_traits::template re\-bind_alloc\brk{}} where \tcode{U} is an unspecified type whose size and alignment are both \tcode{__STDCPP_DEFAULT_NEW_ALIGNMENT__}. @@ -6508,7 +6514,8 @@ \pnum \effects Initializes an allocator \tcode{palloc} of type \tcode{PAlloc} with -\tcode{alloc}. Uses \tcode{palloc} to allocate storage for the +\tcode{alloc}. +Uses \tcode{palloc} to allocate storage for the smallest array of \tcode{U} sufficient to provide storage for a coroutine state of size \tcode{size}, and unspecified additional state necessary to ensure that \tcode{operator delete} can later From 46b2370b05f7aa38e058d05eb2ea802b5e55638c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 21:34:01 +0200 Subject: [PATCH 44/56] fixup: use \brk{} to avoid overfull hbox --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 6f1ce4e5f1..b910e979a7 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5794,7 +5794,7 @@ \tcode{((void)sndr, auto(rcvr))} is potentially-throwing, and \item the expression \tcode{get_completion_scheduler(get_env(sndr))} has -type\linebreak\tcode{inline_scheduler} and is potentially-throwing % avoid Overfull +type\brk{}\tcode{inline_scheduler} and is potentially-throwing if and only if \tcode{get_env(sndr)} is potentially-throwing. \end{itemize} From 915f9804cb4c0057080f113be46bb134513f34ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 23:26:28 +0200 Subject: [PATCH 45/56] fixup: use \placeholder for various local variables and fix overfull hbox --- source/exec.tex | 115 ++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 58 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index b910e979a7..9c7ae2214a 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5732,23 +5732,23 @@ \end{codeblock} \pnum -Let \tcode{out_sndr} be a subexpression denoting a sender +Let \tcode{\placeholder{out_sndr}} be a subexpression denoting a sender returned from \tcode{affine_on(sndr, sch)} or one equal to such, -and let \tcode{OutSndr} be the type \tcode{decltype((out_sndr))}. -Let \tcode{out_rcvr} be a subexpression denoting a receiver that -has an environment of type \tcode{Env} such that \tcode{\libconcept{sender_in}} +and let \tcode{\placeholder{OutSndr}} be the type \tcode{decltype((\placeholder{out_sndr}))}. +Let \tcode{\placeholder{out_rcvr}} be a subexpression denoting a receiver that +has an environment of type \tcode{Env} such that \tcode{\libconcept{sender_in}<\placeholder{OutSndr}, Env>} is \tcode{true}. -Let \tcode{op} be an lvalue referring to the operation state that -results from connecting \tcode{out_sndr} to \tcode{out_rcvr}. -Calling \tcode{start(op)} will start \tcode{sndr} on the current -execution agent and execute completion operations on \tcode{out_rcvr} +Let \tcode{\placeholder{op}} be an lvalue referring to the operation state that +results from connecting \tcode{\placeholder{out_sndr}} to \tcode{\placeholder{out_rcvr}}. +Calling \tcode{start(\placeholder{op})} will start \tcode{sndr} on the current +execution agent and execute completion operations on \tcode{\placeholder{out_rcvr}} on an execution agent of the execution resource associated with \tcode{sch}. If the current execution resource is the same as the execution resource associated with \tcode{sch}, the completion operation on -\tcode{out_rcvr} may be called before \tcode{start(op)} completes. +\tcode{\placeholder{out_rcvr}} may be called before \tcode{start(op)} completes. If scheduling onto \tcode{sch} fails, an error completion on -\tcode{out_rcvr} shall be executed on an unspecified execution +\tcode{\placeholder{out_rcvr}} shall be executed on an unspecified execution agent. \rSec2[exec.inline.scheduler]{\tcode{execution::inline_scheduler}} @@ -5794,22 +5794,22 @@ \tcode{((void)sndr, auto(rcvr))} is potentially-throwing, and \item the expression \tcode{get_completion_scheduler(get_env(sndr))} has -type\brk{}\tcode{inline_scheduler} and is potentially-throwing +type\brk{} \tcode{inline_\-sched\-ul\-er} and is potentially-throwing if and only if \tcode{get_env(sndr)} is potentially-throwing. \end{itemize} \pnum -Let \tcode{o} be a non-const lvalue of type -\tcode{\exposid{inline-state}}, and let \tcode{REC(o)} be -a non-const lvalue reference to an object of type \tcode{Rcvr} that +Let \placeholder{o} be a non-\tcode{const} lvalue of type +\tcode{\exposid{inline-state}}, and let \tcode{REC(@\placeholder{o}@)} be +a non-\tcode{const} lvalue reference to an object of type \tcode{Rcvr} that was initialized with the expression \tcode{rcvr} passed to an -invocation of \tcode{connect} that returned \tcode{o}, then: +invocation of \tcode{connect} that returned \placeholder{o}, then: \begin{itemize} -\item the object to which \tcode{REC(o)} refers remains valid for -the lifetime of the object to which \tcode{o} refers, and -\item the expression \tcode{start(o)} is equivalent to -\tcode{set_value(std::move(REC(o)))}. +\item the object to which \tcode{REC(@\placeholder{o}@)} refers remains valid for +the lifetime of the object to which \tcode{@\placeholder{o}@} refers, and +\item the expression \tcode{start(@\placeholder{o}@)} is equivalent to +\tcode{set_value(std::move(REC(@\placeholder{o}@)))}. \end{itemize} \rSec2[exec.task.scheduler]{\tcode{execution::task_scheduler}} @@ -5860,7 +5860,7 @@ \pnum \effects Initialize \exposid{sch_} with -\tcode{allocate_shared>(alloc,\brk{} std::forward(sch))}. +\tcode{allocate_shared>(alloc,\brk{} std::forward\brk{}(sch))}. \pnum \recommended @@ -5882,7 +5882,7 @@ \pnum \effects Returns an object of type \exposid{ts-sender} containing a sender -initialized with \tcode{sched\-ule(\brk{}\exposid{SCHED}(*this))}. +initialized with \tcode{sched\-ule(\brk{}\exposid{SCHED}\brk{}(*this))}. \end{itemdescr} \begin{itemdecl} @@ -5933,10 +5933,10 @@ \end{codeblock} \pnum -Let \tcode{sch} be an object of type \tcode{task_scheduler} +Let \tcode{\placeholder{sch}} be an object of type \tcode{task_scheduler} and let \tcode{sndr} be an object of type \exposid{ts-sender} obtained -from \tcode{schedule(sch)}. -Then \tcode{get_completion_scheduler(get_env(sndr)) == sch} +from \tcode{schedule(\placeholder{sch})}. +Then \tcode{get_completion_scheduler(get_env(sndr)) == \placeholder{sch}} is \tcode{true}. The object \tcode{SENDER(sndr)} is the sender object contained by \tcode{sndr} or an object move constructed from it. @@ -5948,12 +5948,12 @@ \pnum \effects -Let \tcode{r} be an object of a type that models \libconcept{receiver} +Let \tcode{\placeholder{r}} be an object of a type that models \libconcept{receiver} and whose completion handlers result in invoking the corresponding completion handlers of \tcode{rcvr} or copy thereof. Returns an object of type \tcode{\exposid{state}} containing an operation state object initialized with \tcode{connect(SENDER(*this), -std::move(r))}. +std::move(\placeholder{r}))}. \begin{codeblock} template<@\libconcept{receiver}@ R> @@ -6151,7 +6151,7 @@ \begin{itemdescr} \pnum The type \exposid{own-env-t} is \tcode{Environment::template -env_type()))>} if that +env_type(\brk{})))\brk{}>} if that qualified-id is valid and denotes a type, \tcode{env<>} otherwise. \end{itemdescr} @@ -6199,37 +6199,36 @@ \begin{itemdescr} \pnum \effects -Let \tcode{prom} be the object \tcode{\exposid{handle}.promise()}. -Associates \tcode{STATE(prom)}, \tcode{RCVR(prom)}, and \tcode{SCHED(prom)} +Let \tcode{\placeholder{prom}} be the object \tcode{\exposid{handle}.promise()}. +Associates \tcode{STATE(\placeholder{prom})}, \tcode{RCVR(\placeholder{prom})}, and \tcode{SCHED(\placeholder{prom})} with \tcode{*this} as follows: \begin{itemize} -\item \tcode{STATE(prom)} is \tcode{*this}. -\item \tcode{RCVR(prom)} is \exposid{rcvr}. -\item \tcode{SCHED(prom)} is the object initialized +\item \tcode{STATE(\placeholder{prom})} is \tcode{*this}. +\item \tcode{RCVR(\placeholder{prom})} is \exposid{rcvr}. +\item \tcode{SCHED(\placeholder{prom})} is the object initialized with \tcode{scheduler_type(get_scheduler(get_env(\exposid{rcvr})))} if that expression is valid and \tcode{scheduler_type()} otherwise. If neither of these expressions is valid, the program is ill-formed. \end{itemize} -Let \tcode{st} be \tcode{get_stop_token(get_env(\exposid{rcvr}))}. -Initializes \tcode{prom.\exposid{token}} and -\tcode{prom.\exposid{source}} such that +Let \tcode{\placeholder{st}} be \tcode{get_stop_token(get_env(\exposid{rcvr}))}. +Initializes \tcode{\placeholder{prom}.\exposid{token}} and +\tcode{\placeholder{prom}.\exposid{source}} such that \begin{itemize} \item -\tcode{prom.\exposid{token}.stop_requested()} returns -\tcode{st.stop_requested()}; +\tcode{\placeholder{prom}.\exposid{token}.stop_requested()} returns +\tcode{\placeholder{st}.stop_requested()}; \item -\tcode{prom.\exposid{token}.stop_possible()} returns -\tcode{st.stop_possible()}; and +\tcode{\placeholder{prom}.\exposid{token}.stop_possible()} returns +\tcode{\placeholder{st}.stop_possible()}; and \item for types \tcode{Fn} and \tcode{Init} such that both \tcode{\libconcept{invocable}} and \tcode{\libconcept{constructible_from}} are modeled, \tcode{stop_token_type::callback_type} models -\tcode{\exposconcept{stoppable-callback-for}}. -Init>}. +\tcode{\exposconcept{stoppable-callback-for}}. \end{itemize} After that invokes \tcode{\exposid{handle}.resume()}. @@ -6301,11 +6300,11 @@ \end{codeblock} \pnum -Let \tcode{prom} be an object of \tcode{promise_type} and let \tcode{tsk} be -the \tcode{task} object created by \tcode{prom.get_return_object()}. -The description below refers to objects \tcode{STATE(prom)}, -\tcode{RCVR(prom)}, and \tcode{SCHED(prom)} associated -with \tcode{tsk} during evalutation of \tcode{task::\exposid{state}::start} +Let \tcode{\placeholder{prom}} be an object of \tcode{promise_type} and let \tcode{\placeholder{tsk}} be +the \tcode{task} object created by \tcode{\placeholder{prom}.get_return_object()}. +The description below refers to objects \tcode{STATE(\placeholder{prom})}, +\tcode{RCVR(\placeholder{prom})}, and \tcode{SCHED(\placeholder{prom})} associated +with \tcode{\placeholder{tsk}} during evalutation of \tcode{task::\exposid{state}::start} for some receiver \tcode{Rcvr}. \pnum @@ -6342,7 +6341,7 @@ \pnum \returns A \tcode{task} object whose member \exposid{handle} is -\tcode{coroutine_handle::\brk{}from_promise(*this)}. +\tcode{coroutine_handle::\brk{}from_promise\brk{}(*this)}. \end{itemdescr} \begin{itemdecl} @@ -6396,7 +6395,7 @@ \mandates \tcode{std::move(err.error)} is convertible to exactly one of the \tcode{set_error_t} argument types of \tcode{error_types}. -Let \tcode{Cerr} be that type. +Let \tcode{\placeholder{Cerr}} be that type. \pnum \returns @@ -6404,7 +6403,7 @@ member functions arrange for the calling coroutine to be suspended and then completes the asynchronous operation associated with \tcode{STATE(*this)} by invoking \tcode{set_error(std::move(RCVR(*this)), -Cerr(std::move(err.error)))}. +\placeholder{Cerr}(std::move(err.error)))}. \end{itemdescr} \begin{itemdecl} @@ -6415,10 +6414,10 @@ \begin{itemdescr} \pnum \returns -If \tcode{@\libconcept{same_as}@} is \tcode{true} -returns \tcode{as_awaitable(\brk{}std::forward(sndr), *this)}; +If \tcode{\libconcept{same_as}} is \tcode{true} +returns \tcode{as_awaitable(\brk{}std::\brk{}for\-ward(sndr), *this)}; otherwise returns -\tcode{as_awaitable(affine_on(\brk{}std::forward(sndr), \exposid{SCHED}(*this)), *this)}. +\tcode{as_awaitable(affine_on(\brk{}std::\brk{}for\-ward(sndr), \exposid{SCHED}(*this)), *this)}. \end{itemdescr} \begin{itemdecl} @@ -6493,10 +6492,10 @@ \begin{itemdescr} \pnum If there is no parameter with type \tcode{allocator_arg_t} then let -\tcode{alloc} be \tcode{Allocator()}. -Let \tcode{arg_next} be the parameter following the first -\tcode{allocator_arg_t} parameter (if any) and let \tcode{alloc} -be \tcode{Allocator(arg_next)}. +\tcode{\placeholder{alloc}} be \tcode{Allocator()}. +Let \tcode{\placeholder{arg_next}} be the parameter following the first +\tcode{allocator_arg_t} parameter (if any) and let \tcode{\placeholder{alloc}} +be \tcode{Allocator(\placeholder{arg_next})}. Then \tcode{PAlloc} is \tcode{allocator_traits::template re\-bind_alloc\brk{}} where \tcode{U} is an unspecified type whose size and alignment are both \tcode{__STDCPP_DEFAULT_NEW_ALIGNMENT__}. @@ -6506,7 +6505,7 @@ \begin{itemize} \item The first parameter of type \tcode{allocator_arg_t} (if any) is not the last parameter. -\item \tcode{Allocator(arg_next)} is a valid expression if there is a parameter +\item \tcode{Allocator(\placeholder{arg_next})} is a valid expression if there is a parameter of type \tcode{allocator_arg_t}. \item \tcode{allocator_traits::pointer} is a pointer type. \end{itemize} @@ -6514,7 +6513,7 @@ \pnum \effects Initializes an allocator \tcode{palloc} of type \tcode{PAlloc} with -\tcode{alloc}. +\tcode{\placeholder{alloc}}. Uses \tcode{palloc} to allocate storage for the smallest array of \tcode{U} sufficient to provide storage for a coroutine state of size \tcode{size}, and unspecified additional From 069a65b70a8a84efc6fc4a15d228558281112642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 23:42:32 +0200 Subject: [PATCH 46/56] fixup: added \libglobal in places it was missing --- source/exec.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 9c7ae2214a..9c0f4ed915 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5816,7 +5816,7 @@ \begin{codeblock} namespace std::execution { - class task_scheduler { + class @\libglobal{task_scheduler}@ { class @\exposidnc{ts-sender}@; // \expos template<@\libconcept{receiver}@ R> class @\exposidnc{state}@; // \expos @@ -6000,7 +6000,7 @@ \begin{codeblock} namespace std::execution { template - class task { + class @\libglobal{task}@ { // \ref{task.state} template<@\libconcept{receiver}@ Rcvr> class @\exposidnc{state}@; // \expos @@ -6239,7 +6239,7 @@ \begin{codeblock} namespace std::execution { template - struct with_error { + struct @\libglobal{with_error}@ { using type = remove_cvref_t; type error; }; From ff89435363085b8db5fead50dd87a546b9a30efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 12 Jul 2025 23:59:06 +0200 Subject: [PATCH 47/56] fixup: added \exposids to specification macros --- source/exec.tex | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 9c0f4ed915..dc5a936eca 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5848,7 +5848,7 @@ \tcode{task_scheduler} is a class that models \libconcept{scheduler}\iref{exec.sched}. Given on object \tcode{s} of type \tcode{task_scheduler}, let -\tcode{SCHED(s)} be the object owned by \tcode{s.\exposid{sch_}}. +\tcode{\exposid{SCHED}(s)} be the object owned by \tcode{s.\exposid{sch_}}. \begin{itemdecl} template> @@ -5892,7 +5892,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return lhs == SCHED(rhs);} +Equivalent to: \tcode{return lhs == \exposid{SCHED}(rhs);} \end{itemdescr} \begin{itemdecl} @@ -5905,8 +5905,8 @@ \begin{itemdescr} \pnum \returns -\tcode{false} if type of \tcode{SCHED(lhs)} is not \tcode{Sch}, -otherwise \tcode{SCHED(lhs) == rhs;} +\tcode{false} if type of \tcode{\exposid{SCHED}(lhs)} is not \tcode{Sch}, +otherwise \tcode{\exposid{SCHED}(lhs) == rhs;} \end{itemdescr} \begin{codeblock} @@ -5938,7 +5938,7 @@ from \tcode{schedule(\placeholder{sch})}. Then \tcode{get_completion_scheduler(get_env(sndr)) == \placeholder{sch}} is \tcode{true}. -The object \tcode{SENDER(sndr)} is the sender object contained by +The object \tcode{\exposid{SENDER}(sndr)} is the sender object contained by \tcode{sndr} or an object move constructed from it. \begin{itemdecl} @@ -5952,7 +5952,7 @@ and whose completion handlers result in invoking the corresponding completion handlers of \tcode{rcvr} or copy thereof. Returns an object of type \tcode{\exposid{state}} containing -an operation state object initialized with \tcode{connect(SENDER(*this), +an operation state object initialized with \tcode{connect(\exposid{SENDER}(*this), std::move(\placeholder{r}))}. \begin{codeblock} @@ -6200,13 +6200,13 @@ \pnum \effects Let \tcode{\placeholder{prom}} be the object \tcode{\exposid{handle}.promise()}. -Associates \tcode{STATE(\placeholder{prom})}, \tcode{RCVR(\placeholder{prom})}, and \tcode{SCHED(\placeholder{prom})} +Associates \tcode{\exposid{STATE}(\placeholder{prom})}, \tcode{\exposid{RCVR}(\placeholder{prom})}, and \tcode{\exposid{SCHED}(\placeholder{prom})} with \tcode{*this} as follows: \begin{itemize} -\item \tcode{STATE(\placeholder{prom})} is \tcode{*this}. -\item \tcode{RCVR(\placeholder{prom})} is \exposid{rcvr}. -\item \tcode{SCHED(\placeholder{prom})} is the object initialized +\item \tcode{\exposid{STATE}(\placeholder{prom})} is \tcode{*this}. +\item \tcode{\exposid{RCVR}(\placeholder{prom})} is \exposid{rcvr}. +\item \tcode{\exposid{SCHED}(\placeholder{prom})} is the object initialized with \tcode{scheduler_type(get_scheduler(get_env(\exposid{rcvr})))} if that expression is valid and \tcode{scheduler_type()} otherwise. If neither of these expressions is valid, the program is ill-formed. @@ -6302,8 +6302,8 @@ \pnum Let \tcode{\placeholder{prom}} be an object of \tcode{promise_type} and let \tcode{\placeholder{tsk}} be the \tcode{task} object created by \tcode{\placeholder{prom}.get_return_object()}. -The description below refers to objects \tcode{STATE(\placeholder{prom})}, -\tcode{RCVR(\placeholder{prom})}, and \tcode{SCHED(\placeholder{prom})} associated +The description below refers to objects \tcode{\exposid{STATE}(\placeholder{prom})}, +\tcode{\exposid{RCVR}(\placeholder{prom})}, and \tcode{\exposid{SCHED}(\placeholder{prom})} associated with \tcode{\placeholder{tsk}} during evalutation of \tcode{task::\exposid{state}::start} for some receiver \tcode{Rcvr}. @@ -6357,7 +6357,7 @@ \begin{itemize} \item the calling coroutine to be suspended, \item the coroutine to be resumed on an execution agent of the -execution resource associated with \tcode{SCHED(*this)}. +execution resource associated with \tcode{\exposid{SCHED}(*this)}. \end{itemize} \end{itemdescr} @@ -6370,18 +6370,18 @@ \returns An awaitable object of unspecified type \iref{expr.await} whose member functions arrange for the completion of the asynchronous -operation associated with \tcode{STATE(*this)} by invoking: +operation associated with \tcode{\exposid{STATE}(*this)} by invoking: \begin{itemize} \item - \tcode{set_error(std::move(RCVR(*this)), std::move(e))} + \tcode{set_error(std::move(\exposid{RCVR}(*this)), std::move(e))} if \tcode{\exposid{errors}.index()} is greater than zero and \tcode{e} is the value held by \exposid{errors}, otherwise \item - \tcode{set_value(std::move(RCVR(*this)))} if \tcode{is_void} is \tcode{true}, + \tcode{set_value(std::move(\exposid{RCVR}(*this)))} if \tcode{is_void} is \tcode{true}, and otherwise \item - \tcode{set_value(std::move(RCVR(*this)), *\exposid{result})}. + \tcode{set_value(std::move(\exposid{RCVR}(*this)), *\exposid{result})}. \end{itemize} \end{itemdescr} @@ -6402,7 +6402,7 @@ An awaitable object of unspecified type\iref{expr.await} whose member functions arrange for the calling coroutine to be suspended and then completes the asynchronous operation associated with -\tcode{STATE(*this)} by invoking \tcode{set_error(std::move(RCVR(*this)), +\tcode{\exposid{STATE}(*this)} by invoking \tcode{set_error(std::move(\exposid{RCVR}(*this)), \placeholder{Cerr}(std::move(err.error)))}. \end{itemdescr} @@ -6430,7 +6430,7 @@ \effects Equivalent to: \begin{codeblock} -return await_transform(just(exchange(SCHED(*this), scheduler_type(sch.scheduler))), *this); +return await_transform(just(exchange(@\exposid{SCHED}@(*this), scheduler_type(sch.scheduler))), *this); \end{codeblock} \end{itemdescr} @@ -6453,8 +6453,8 @@ \begin{itemdescr} \pnum \effects -Completes the asynchronous operation associated with \tcode{STATE(*this)} -by invoking \tcode{set_stopped(std::move(RCVR(*this)))}. +Completes the asynchronous operation associated with \tcode{\exposid{STATE}(*this)} +by invoking \tcode{set_stopped(std::move(\exposid{RCVR}(*this)))}. \end{itemdescr} \begin{itemdescr} @@ -6473,12 +6473,12 @@ An object \tcode{env} such that queries are forwarded as follows: \begin{itemize} -\item \tcode{env.query(get_scheduler)} returns \tcode{scheduler_type(SCHED(*this))}. +\item \tcode{env.query(get_scheduler)} returns \tcode{scheduler_type(\exposid{SCHED}(*this))}. \item \tcode{env.query(get_allocator)} returns \exposid{alloc}. \item \tcode{env.query(get_stop_token)} returns \exposid{token}. \item For any other query \tcode{q} and arguments \tcode{a...} a call to \tcode{env.query(q, a...)} returns - \tcode{STATE(*this).} \tcode{environment.query(q, a...)} if this expression + \tcode{\exposid{STATE}(*this).} \tcode{environment.query(q, a...)} if this expression is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}. Otherwise \tcode{env.query(q, a...)} is ill-formed. \end{itemize} From 619f2ad92587408001f3d42db0dc1f3b66efcd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 00:05:53 +0200 Subject: [PATCH 48/56] fixup: added use of \grammarterm --- source/exec.tex | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index dc5a936eca..f92eac6777 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5923,7 +5923,6 @@ \exposid{ts-sender} is an exposition-only class that models \libconcept{sender}\iref{exec.snd} and for which \tcode{completion_signatures_of_t<\exposid{ts-sender}>} denotes: - \begin{codeblock} completion_signatures< set_value_t(), @@ -6042,16 +6041,16 @@ \begin{itemize} \item \tcode{allocator_type} is \tcode{Environment::allocator_type} -if that qualified-id is valid and denotes a type, \tcode{allocator} +if that \grammarterm{qualified-id} is valid and denotes a type, \tcode{allocator} otherwise. \item \tcode{scheduler_type} is \tcode{Environment::scheduler_type} -if that qualified-id is valid and denotes a type, \tcode{task_scheduler} +if that \grammarterm{qualified-id} is valid and denotes a type, \tcode{task_scheduler} otherwise. \item \tcode{stop_source_type} is \tcode{Environment::stop_source_type} -if that qualified-id is valid and denotes a type, +if that \grammarterm{qualified-id} is valid and denotes a type, \tcode{inplace_stop_source} otherwise. \item \tcode{error_types} is \tcode{Environment::error_types} if -that qualified-id is valid and denotes a type, +that \grammarterm{qualified-id} is valid and denotes a type, \tcode{com\-pletion_sign\-atures} otherwise. \end{itemize} @@ -6152,7 +6151,7 @@ \pnum The type \exposid{own-env-t} is \tcode{Environment::template env_type(\brk{})))\brk{}>} if that -qualified-id is valid and denotes a type, \tcode{env<>} otherwise. +\grammarterm{qualified-id} is valid and denotes a type, \tcode{env<>} otherwise. \end{itemdescr} \begin{itemdecl} From 89ca3eb4a9da146381aa57f7ebee9a4f3821df19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 00:09:19 +0200 Subject: [PATCH 49/56] removed incorrect empty lines before \begin{itemize} --- source/exec.tex | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index f92eac6777..d91603715e 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5786,7 +5786,6 @@ \tcode{\libconcept{receiver_of}} is \tcode{true} where \tcode{CS} is \tcode{completion_signatures}, then: - \begin{itemize} \item the expression \tcode{connect(sndr, rcvr)} has type \tcode{\exposid{inline-state}>} @@ -5804,7 +5803,6 @@ a non-\tcode{const} lvalue reference to an object of type \tcode{Rcvr} that was initialized with the expression \tcode{rcvr} passed to an invocation of \tcode{connect} that returned \placeholder{o}, then: - \begin{itemize} \item the object to which \tcode{REC(@\placeholder{o}@)} refers remains valid for the lifetime of the object to which \tcode{@\placeholder{o}@} refers, and @@ -6038,7 +6036,6 @@ \pnum The nested types of \tcode{task} template specializations are determined based on the \tcode{Environment} parameter: - \begin{itemize} \item \tcode{allocator_type} is \tcode{Environment::allocator_type} if that \grammarterm{qualified-id} is valid and denotes a type, \tcode{allocator} @@ -6064,7 +6061,6 @@ The type alias \tcode{completion_signatures} is a specialization of \tcode{execution::completion_signatures} with the template arguments (in unspecified order): - \begin{itemize} \item \tcode{set_value_t()} if \tcode{T} is \tcode{void}, and \tcode{set_value_t(T)} otherwise; @@ -6201,7 +6197,6 @@ Let \tcode{\placeholder{prom}} be the object \tcode{\exposid{handle}.promise()}. Associates \tcode{\exposid{STATE}(\placeholder{prom})}, \tcode{\exposid{RCVR}(\placeholder{prom})}, and \tcode{\exposid{SCHED}(\placeholder{prom})} with \tcode{*this} as follows: - \begin{itemize} \item \tcode{\exposid{STATE}(\placeholder{prom})} is \tcode{*this}. \item \tcode{\exposid{RCVR}(\placeholder{prom})} is \exposid{rcvr}. @@ -6214,7 +6209,6 @@ Let \tcode{\placeholder{st}} be \tcode{get_stop_token(get_env(\exposid{rcvr}))}. Initializes \tcode{\placeholder{prom}.\exposid{token}} and \tcode{\placeholder{prom}.\exposid{source}} such that - \begin{itemize} \item \tcode{\placeholder{prom}.\exposid{token}.stop_requested()} returns @@ -6352,7 +6346,6 @@ \returns An awaitable object of unspecified type\iref{expr.await} whose member functions arrange for - \begin{itemize} \item the calling coroutine to be suspended, \item the coroutine to be resumed on an execution agent of the @@ -6370,7 +6363,6 @@ An awaitable object of unspecified type \iref{expr.await} whose member functions arrange for the completion of the asynchronous operation associated with \tcode{\exposid{STATE}(*this)} by invoking: - \begin{itemize} \item \tcode{set_error(std::move(\exposid{RCVR}(*this)), std::move(e))} @@ -6470,7 +6462,6 @@ \pnum \returns An object \tcode{env} such that queries are forwarded as follows: - \begin{itemize} \item \tcode{env.query(get_scheduler)} returns \tcode{scheduler_type(\exposid{SCHED}(*this))}. \item \tcode{env.query(get_allocator)} returns \exposid{alloc}. @@ -6501,7 +6492,6 @@ \pnum \mandates - \begin{itemize} \item The first parameter of type \tcode{allocator_arg_t} (if any) is not the last parameter. \item \tcode{Allocator(\placeholder{arg_next})} is a valid expression if there is a parameter From 9953567985c8c3720b2d0561ca8802505684f1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 00:57:39 +0200 Subject: [PATCH 50/56] fixup: added \indexlibrary* and fixed missing or excess spaces --- source/exec.tex | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index d91603715e..2b39dd4c13 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5848,6 +5848,7 @@ Given on object \tcode{s} of type \tcode{task_scheduler}, let \tcode{\exposid{SCHED}(s)} be the object owned by \tcode{s.\exposid{sch_}}. +\indexlibraryctor{task_scheduler} \begin{itemdecl} template> requires(!@\libconcept{same_as}@>) && @\libconcept{scheduler}@ @@ -5872,6 +5873,7 @@ performed using a copy of \tcode{alloc}. \end{itemdescr} +\indexlibrarymember{scheduler}{task_scheduler}% \begin{itemdecl} @\exposid{ts-sender}@ schedule(); \end{itemdecl} @@ -5883,6 +5885,7 @@ initialized with \tcode{sched\-ule(\brk{}\exposid{SCHED}\brk{}(*this))}. \end{itemdescr} +\indexlibrarymember{operator==}{task_scheduler}% \begin{itemdecl} bool operator==(const task_scheduler& lhs, const task_scheduler& rhs) noexcept; \end{itemdecl} @@ -5893,6 +5896,7 @@ Equivalent to: \tcode{return lhs == \exposid{SCHED}(rhs);} \end{itemdescr} +\indexlibrarymember{operator==}{task_scheduler}% \begin{itemdecl} template requires (!@\libconcept{same_as}@) @@ -5938,6 +5942,7 @@ The object \tcode{\exposid{SENDER}(sndr)} is the sender object contained by \tcode{sndr} or an object move constructed from it. +\indexlibrarymember{connect}{task_scheduler::\exposid{ts-sender}}% \begin{itemdecl} template<@\libconcept{receiver}@ Rcvr> @\exposid{state}@ connect(Rcvr&& rcvr); @@ -5966,6 +5971,7 @@ \exposid{state} is an exposition-only class template whose specializations model \libconcept{operation_state}\iref{exec.opstate}. +\indexlibrarymember{start}{task_scheduler::\exposid{state}}% \begin{itemdecl} void start() & noexcept; \end{itemdecl} @@ -5985,7 +5991,7 @@ The \tcode{task} class template represents a sender that can be used as the return type of coroutines. The first template parameter \tcode{T} defines the type of the value -completion datum \iref{exec.async.ops} if \tcode{T} is not \tcode{void}. +completion datum\iref{exec.async.ops} if \tcode{T} is not \tcode{void}. Otherwise, there are no value completion datums. Inside coroutines returning \tcode{task} the operand of \tcode{co_return} (if any) becomes the argument of \tcode{set_value}. @@ -6076,6 +6082,7 @@ \rSec3[task.members]{\tcode{task} Members} +\indexlibraryctor{task}% \begin{itemdecl} task(task&& other) noexcept; \end{itemdecl} @@ -6087,6 +6094,7 @@ \{\})}. \end{itemdescr} +\indexlibrarydtor{task}% \begin{itemdecl} ~task(); \end{itemdecl} @@ -6102,6 +6110,7 @@ \end{codeblock} \end{itemdescr} +\indexlibrarymember{connect}{task}% \begin{itemdecl} template<@\libconcept{receiver}@ R> @\exposid{state}@ connect(R&& recv); @@ -6150,6 +6159,7 @@ \grammarterm{qualified-id} is valid and denotes a type, \tcode{env<>} otherwise. \end{itemdescr} +\indexlibraryctor{task::\exposid{state}}% \begin{itemdecl} template @\exposid{state}@(coroutine_handle h, R&& rr); @@ -6172,6 +6182,7 @@ If neither of these expressions is valid, the program is ill-formed. \end{itemdescr} +\indexlibrarydtor{task::\exposid{state}}% \begin{itemdecl} ~@\exposid{state}@(); \end{itemdecl} @@ -6187,6 +6198,7 @@ \end{codeblock} \end{itemdescr} +\indexlibrarymember{start}{task::\exposid{state}}% \begin{itemdecl} void start() & noexcept; \end{itemdecl} @@ -6261,9 +6273,9 @@ void uncaught_exception(); coroutine_handle<> unhandled_stopped(); - void return_void(); // present only if \tcode{is_void_v} is \tcode{true}; + void return_void(); // present only if \tcode{is_void_v} is \tcode{true}; template - void return_value(V&& value); // present only if \tcode{is_void_v} is \tcode{false}; + void return_value(V&& value); // present only if \tcode{is_void_v} is \tcode{false}; template @\unspec@ yield_value(with_error error); @@ -6307,6 +6319,7 @@ \tcode{execution::completion_signatures} denoted by \tcode{error_types}. +\indexlibraryctor{task::promise_type}% \begin{itemdecl} template promise_type(const Args&... args); @@ -6326,6 +6339,7 @@ Otherwise, \exposid{alloc} is initialized with \tcode{allocator_type()}. \end{itemdescr} +\indexlibrarymember{get_return_object}{task::promise_type}% \begin{itemdecl} task get_return_object() noexcept; \end{itemdecl} @@ -6337,6 +6351,7 @@ \tcode{coroutine_handle::\brk{}from_promise\brk{}(*this)}. \end{itemdescr} +\indexlibrarymember{initial_suspend}{task::promise_type}% \begin{itemdecl} auto initial_suspend() noexcept; \end{itemdecl} @@ -6353,6 +6368,7 @@ \end{itemize} \end{itemdescr} +\indexlibrarymember{final_suspend}{task::promise_type}% \begin{itemdecl} auto final_suspend() noexcept; \end{itemdecl} @@ -6360,7 +6376,7 @@ \begin{itemdescr} \pnum \returns -An awaitable object of unspecified type \iref{expr.await} whose +An awaitable object of unspecified type\iref{expr.await} whose member functions arrange for the completion of the asynchronous operation associated with \tcode{\exposid{STATE}(*this)} by invoking: \begin{itemize} @@ -6376,6 +6392,7 @@ \end{itemize} \end{itemdescr} +\indexlibrarymember{yield_value}{task::promise_type}% \begin{itemdecl} template auto yield_value(with_error err); @@ -6397,6 +6414,7 @@ \placeholder{Cerr}(std::move(err.error)))}. \end{itemdescr} +\indexlibrarymember{await_transform}{task::promise_type}% \begin{itemdecl} template<@\libconcept{sender}@ Sender> auto await_transform(Sender&& sndr) noexcept; @@ -6411,6 +6429,7 @@ \tcode{as_awaitable(affine_on(\brk{}std::\brk{}for\-ward(sndr), \exposid{SCHED}(*this)), *this)}. \end{itemdescr} +\indexlibrarymember{await_transform}{task::promise_type}% \begin{itemdecl} template auto await_transform(change_coroutine_scheduler sch) noexcept; @@ -6425,6 +6444,7 @@ \end{codeblock} \end{itemdescr} +\indexlibrarymember{uncaught_exception}{task::promise_type}% \begin{itemdecl} void uncaught_exception(); \end{itemdecl} @@ -6437,6 +6457,7 @@ Otherwise, stores \tcode{current_exception()} into \exposid{errors}. \end{itemdescr} +\indexlibrarymember{unhandled_stopped}{task::promise_type}% \begin{itemdecl} coroutine_handle<> unhandled_stopped(); \end{itemdecl} @@ -6454,6 +6475,7 @@ \tcode{noop_coroutine()}. \end{itemdescr} +\indexlibrarymember{get_env}{task::promise_type}% \begin{itemdecl} @\unspec@ get_env() const noexcept; \end{itemdecl} @@ -6474,6 +6496,7 @@ \end{itemize} \end{itemdescr} +\indexlibrarymember{operator new}{task::promise_type}% \begin{itemdecl} template void* operator new(size_t size, const Args&... args); @@ -6514,6 +6537,7 @@ A pointer to the allocated storage. \end{itemdescr} +\indexlibrarymember{operator delete}{task::promise_type}% \begin{itemdecl} void operator delete(void* pointer, size_t size) noexcept; \end{itemdecl} From 2ec36bb49f287d73cd17e8dcf9ebbb0f13d3ceed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 01:03:52 +0200 Subject: [PATCH 51/56] fixup: added missing \begin{itemize} and removed leading spaces --- source/exec.tex | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 2b39dd4c13..a7ba156c5b 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6103,7 +6103,6 @@ \pnum \effects Equivalent to: - \begin{codeblock} if (@\exposid{handle}@) @\exposid{handle}@.destroy(); @@ -6169,18 +6168,19 @@ \pnum \effects Initializes - +\begin{itemize} \item \exposid{handle} with \tcode{std::move(h)}; \item \exposid{rcvr} with \tcode{std::forward(rr)}; \item \exposid{own-env} - with \tcode{\exposid{own-env-t}(get_env(\exposid{rcvr}))} if that expression - is valid and \tcode{\exposid{own-env-t}()} otherwise. - If neither of these expressions is valid, the program is ill-formed. +with \tcode{\exposid{own-env-t}(get_env(\exposid{rcvr}))} if that expression +is valid and \tcode{\exposid{own-env-t}()} otherwise. +If neither of these expressions is valid, the program is ill-formed. \item \exposid{environment} with \tcode{Environment(\exposid{own-env})} if that expression is - valid, otherwise \tcode{Environment(get_env(\exposid{rcvr}))} - if this expression is valid, otherwise \tcode{Environment()}. - If neither of these expressions is valid, the program is ill-formed. +valid, otherwise \tcode{Environment(get_env(\exposid{rcvr}))} +if this expression is valid, otherwise \tcode{Environment()}. +If neither of these expressions is valid, the program is ill-formed. \end{itemdescr} +\end{itemize} \indexlibrarydtor{task::\exposid{state}}% \begin{itemdecl} @@ -6191,7 +6191,6 @@ \pnum \effects Equivalent to: - \begin{codeblock} if (@\exposid{handle}@) @\exposid{handle}@.destroy(); @@ -6381,12 +6380,12 @@ operation associated with \tcode{\exposid{STATE}(*this)} by invoking: \begin{itemize} \item - \tcode{set_error(std::move(\exposid{RCVR}(*this)), std::move(e))} - if \tcode{\exposid{errors}.index()} is greater than zero and - \tcode{e} is the value held by \exposid{errors}, otherwise +\tcode{set_error(std::move(\exposid{RCVR}(*this)), std::move(e))} +if \tcode{\exposid{errors}.index()} is greater than zero and +\tcode{e} is the value held by \exposid{errors}, otherwise \item - \tcode{set_value(std::move(\exposid{RCVR}(*this)))} if \tcode{is_void} is \tcode{true}, - and otherwise +\tcode{set_value(std::move(\exposid{RCVR}(*this)))} if \tcode{is_void} is \tcode{true}, +and otherwise \item \tcode{set_value(std::move(\exposid{RCVR}(*this)), *\exposid{result})}. \end{itemize} @@ -6489,10 +6488,10 @@ \item \tcode{env.query(get_allocator)} returns \exposid{alloc}. \item \tcode{env.query(get_stop_token)} returns \exposid{token}. \item For any other query \tcode{q} and arguments \tcode{a...} a - call to \tcode{env.query(q, a...)} returns - \tcode{\exposid{STATE}(*this).} \tcode{environment.query(q, a...)} if this expression - is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}. - Otherwise \tcode{env.query(q, a...)} is ill-formed. +call to \tcode{env.query(q, a...)} returns +\tcode{\exposid{STATE}(*this).} \tcode{environment.query(q, a...)} if this expression +is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}. +Otherwise \tcode{env.query(q, a...)} is ill-formed. \end{itemize} \end{itemdescr} @@ -6518,7 +6517,7 @@ \begin{itemize} \item The first parameter of type \tcode{allocator_arg_t} (if any) is not the last parameter. \item \tcode{Allocator(\placeholder{arg_next})} is a valid expression if there is a parameter - of type \tcode{allocator_arg_t}. +of type \tcode{allocator_arg_t}. \item \tcode{allocator_traits::pointer} is a pointer type. \end{itemize} From 70456ebe2b2681393bf3da89887c1c1e48356150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 01:07:56 +0200 Subject: [PATCH 52/56] fixup: indent function templates after template head --- source/exec.tex | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index a7ba156c5b..d7f52da313 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6248,7 +6248,7 @@ type error; }; template - with_error(E) -> with_error; + with_error(E) -> with_error; template<@\libconcept{scheduler}@ Sch> struct change_coroutine_scheduler { @@ -6256,13 +6256,13 @@ type scheduler; }; template<@\libconcept{scheduler}@ Sch> - change_coroutine_scheduler(Sch) -> change_coroutine_scheduler; + change_coroutine_scheduler(Sch) -> change_coroutine_scheduler; template class task::promise_type { public: template - promise_type(const Args&... args); + promise_type(const Args&... args); task get_return_object() noexcept; @@ -6277,17 +6277,17 @@ void return_value(V&& value); // present only if \tcode{is_void_v} is \tcode{false}; template - @\unspec@ yield_value(with_error error); + @\unspec@ yield_value(with_error error); template - auto await_transform(A&& a); + auto await_transform(A&& a); template - auto await_transform(change_coroutine_scheduler sch); + auto await_transform(change_coroutine_scheduler sch); @\unspec@ get_env() const noexcept; template - void* operator new(size_t size, Args&&... args); + void* operator new(size_t size, Args&&... args); void operator delete(void* pointer, size_t size) noexcept; @@ -6321,7 +6321,7 @@ \indexlibraryctor{task::promise_type}% \begin{itemdecl} template -promise_type(const Args&... args); + promise_type(const Args&... args); \end{itemdecl} \begin{itemdescr} @@ -6394,7 +6394,7 @@ \indexlibrarymember{yield_value}{task::promise_type}% \begin{itemdecl} template -auto yield_value(with_error err); + auto yield_value(with_error err); \end{itemdecl} \begin{itemdescr} @@ -6416,7 +6416,7 @@ \indexlibrarymember{await_transform}{task::promise_type}% \begin{itemdecl} template<@\libconcept{sender}@ Sender> -auto await_transform(Sender&& sndr) noexcept; + auto await_transform(Sender&& sndr) noexcept; \end{itemdecl} \begin{itemdescr} @@ -6431,7 +6431,7 @@ \indexlibrarymember{await_transform}{task::promise_type}% \begin{itemdecl} template -auto await_transform(change_coroutine_scheduler sch) noexcept; + auto await_transform(change_coroutine_scheduler sch) noexcept; \end{itemdecl} \begin{itemdescr} @@ -6498,7 +6498,7 @@ \indexlibrarymember{operator new}{task::promise_type}% \begin{itemdecl} template -void* operator new(size_t size, const Args&... args); + void* operator new(size_t size, const Args&... args); \end{itemdecl} \begin{itemdescr} From 7361f74722a425eb276c2b879f99f67e452afa6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 01:34:26 +0200 Subject: [PATCH 53/56] fixup: \end{itemize} was in the wrong location --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index d7f52da313..0610656e90 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -6174,13 +6174,13 @@ \item \exposid{own-env} with \tcode{\exposid{own-env-t}(get_env(\exposid{rcvr}))} if that expression is valid and \tcode{\exposid{own-env-t}()} otherwise. +\end{itemize} If neither of these expressions is valid, the program is ill-formed. \item \exposid{environment} with \tcode{Environment(\exposid{own-env})} if that expression is valid, otherwise \tcode{Environment(get_env(\exposid{rcvr}))} if this expression is valid, otherwise \tcode{Environment()}. If neither of these expressions is valid, the program is ill-formed. \end{itemdescr} -\end{itemize} \indexlibrarydtor{task::\exposid{state}}% \begin{itemdecl} From 1c45cffe76d86f395744ea12072e55a1e37e97db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 15:48:22 +0200 Subject: [PATCH 54/56] move definition of with_error and change_coroutine_scheduler to synopsis --- source/exec.tex | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 0610656e90..4b88e46c19 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -719,11 +719,23 @@ // \ref{exec.task.scheduler} class @\libglobal{task_scheduler}@; - // \ref{exec.task} template - struct @\libglobal{with_error}@; + struct @\libglobal{with_error}@ { + using type = remove_cvref_t; + type error; + }; + template + with_error(E) -> with_error; + template<@\libconcept{scheduler}@ Sch> - struct @\libglobal{change_coroutine_scheduler}@; + struct change_coroutine_scheduler { + using type = remove_cvref_t; + type scheduler; + }; + template<@\libconcept{scheduler}@ Sch> + change_coroutine_scheduler(Sch) -> change_coroutine_scheduler; + + // \ref{exec.task} template class @\libglobal{task}@; } @@ -6242,22 +6254,6 @@ \begin{codeblock} namespace std::execution { - template - struct @\libglobal{with_error}@ { - using type = remove_cvref_t; - type error; - }; - template - with_error(E) -> with_error; - - template<@\libconcept{scheduler}@ Sch> - struct change_coroutine_scheduler { - using type = remove_cvref_t; - type scheduler; - }; - template<@\libconcept{scheduler}@ Sch> - change_coroutine_scheduler(Sch) -> change_coroutine_scheduler; - template class task::promise_type { public: From 6a24a95ab1bb17dc2beb18051acd6709616f3bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 16:42:41 +0200 Subject: [PATCH 55/56] fixup: fixed a number of formatting issues and a type (he -> The) --- source/exec.tex | 52 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 4b88e46c19..438169c340 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5789,7 +5789,7 @@ \pnum \exposid{inline-sender} is an exposition-only type that satisfies \libconcept{sender}. -he type \tcode{completion_signatures_of_t<\exposid{inline-sender}>} +The type \tcode{completion_signatures_of_t<\exposid{inline-sender}>} is \tcode{completion_signatures}. \pnum @@ -5810,16 +5810,16 @@ \end{itemize} \pnum -Let \placeholder{o} be a non-\tcode{const} lvalue of type -\tcode{\exposid{inline-state}}, and let \tcode{REC(@\placeholder{o}@)} be +Let \tcode{\placeholder{o}} be a non-\tcode{const} lvalue of type +\tcode{\exposid{inline-state}}, and let \tcode{REC(\placeholder{o})} be a non-\tcode{const} lvalue reference to an object of type \tcode{Rcvr} that was initialized with the expression \tcode{rcvr} passed to an -invocation of \tcode{connect} that returned \placeholder{o}, then: +invocation of \tcode{connect} that returned \tcode{\placeholder{o}}, then: \begin{itemize} -\item the object to which \tcode{REC(@\placeholder{o}@)} refers remains valid for -the lifetime of the object to which \tcode{@\placeholder{o}@} refers, and -\item the expression \tcode{start(@\placeholder{o}@)} is equivalent to -\tcode{set_value(std::move(REC(@\placeholder{o}@)))}. +\item the object to which \tcode{REC(\placeholder{o})} refers remains valid for +the lifetime of the object to which \tcode{\placeholder{o}} refers, and +\item the expression \tcode{start(\placeholder{o})} is equivalent to +\tcode{set_value(std::move(REC(\placeholder{o})))}. \end{itemize} \rSec2[exec.task.scheduler]{\tcode{execution::task_scheduler}} @@ -5868,6 +5868,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Initialize \exposid{sch_} with @@ -5891,6 +5892,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Returns an object of type \exposid{ts-sender} containing a sender @@ -5903,6 +5905,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Equivalent to: \tcode{return lhs == \exposid{SCHED}(rhs);} @@ -5917,6 +5920,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \returns \tcode{false} if type of \tcode{\exposid{SCHED}(lhs)} is not \tcode{Sch}, @@ -5989,6 +5993,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Equivalent to \tcode{start(st)} where \tcode{st} is the operation @@ -6100,6 +6105,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Initializes \exposid{handle} with \tcode{exchange(other.\exposid{handle}, @@ -6112,6 +6118,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Equivalent to: @@ -6128,6 +6135,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \expects \tcode{bool(\exposid{handle})} is \tcode{true}. @@ -6154,21 +6162,19 @@ void start() & noexcept; private: - using @\exposidnc{own-env-t}@ = @\seebelow@; // \expos - coroutine_handle @\exposidnc{handle}@; // \expos - remove_cvref_t @\exposidnc{rcvr}@; // \expos - @\exposid{own-env-t}@ @\exposidnc{own-env}@; // \expos + using @\exposidnc{own-env-t}@ = @\seebelow@; // \expos + coroutine_handle @\exposidnc{handle}@; // \expos + remove_cvref_t @\exposidnc{rcvr}@; // \expos + @\exposid{own-env-t}@ @\exposidnc{own-env}@; // \expos Environment @\exposidnc{environment}@; // \expos }; } \end{codeblock} -\begin{itemdescr} \pnum The type \exposid{own-env-t} is \tcode{Environment::template env_type(\brk{})))\brk{}>} if that \grammarterm{qualified-id} is valid and denotes a type, \tcode{env<>} otherwise. -\end{itemdescr} \indexlibraryctor{task::\exposid{state}}% \begin{itemdecl} @@ -6177,6 +6183,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Initializes @@ -6200,6 +6207,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Equivalent to: @@ -6215,6 +6223,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Let \tcode{\placeholder{prom}} be the object \tcode{\exposid{handle}.promise()}. @@ -6294,7 +6303,7 @@ stop_source_type @\exposidnc{source}@; // \expos stop_token_type @\exposidnc{token}@; // \expos optional @\exposidnc{result}@; // \expos; present only if \tcode{is_void_v} is \tcode{false}; - @\exposid{error-variant}@ @\exposidnc{errors}@; // \expos + @\exposid{error-variant}@ @\exposidnc{errors}@; // \expos }; } \end{codeblock} @@ -6321,6 +6330,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \mandates The first parameter of type \tcode{allocator_arg_t} (if any) is not @@ -6340,6 +6350,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \returns A \tcode{task} object whose member \exposid{handle} is @@ -6352,6 +6363,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \returns An awaitable object of unspecified type\iref{expr.await} whose @@ -6369,6 +6381,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \returns An awaitable object of unspecified type\iref{expr.await} whose @@ -6394,6 +6407,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \mandates \tcode{std::move(err.error)} is convertible to exactly one of the @@ -6416,6 +6430,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \returns If \tcode{\libconcept{same_as}} is \tcode{true} @@ -6431,6 +6446,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Equivalent to: @@ -6445,6 +6461,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects If the signature \tcode{set_error_t(exception_ptr)} is not an element @@ -6458,6 +6475,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \effects Completes the asynchronous operation associated with \tcode{\exposid{STATE}(*this)} @@ -6465,6 +6483,7 @@ \end{itemdescr} \begin{itemdescr} + \pnum \returns \tcode{noop_coroutine()}. @@ -6476,6 +6495,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \returns An object \tcode{env} such that queries are forwarded as follows: @@ -6498,6 +6518,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum If there is no parameter with type \tcode{allocator_arg_t} then let \tcode{\placeholder{alloc}} be \tcode{Allocator()}. @@ -6538,6 +6559,7 @@ \end{itemdecl} \begin{itemdescr} + \pnum \expects \tcode{pointer} was returned from an invocation of the above overload From 5df4a38d14d138778b3a80307410f96f8c34af13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 13 Jul 2025 16:57:01 +0200 Subject: [PATCH 56/56] fixup: remove \irefs which weren't in the proposal --- source/exec.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 438169c340..ac4ebcc094 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -5728,7 +5728,7 @@ except that \tcode{sndr} is evalutated only once. \pnum -The exposition-only class template \exposid{impls-for}\iref{exec.snd.general} +The exposition-only class template \exposid{impls-for} is specialized for \tcode{affine_on_t} as follows: \begin{codeblock} @@ -6095,7 +6095,7 @@ \pnum \tcode{allocator_type} shall meet the \oldconcept{Allocator} -requirements\iref{allocator.requirements.general}. +requirements. \rSec3[task.members]{\tcode{task} Members}