|
5695 | 5695 |
|
5696 | 5696 | \pnum |
5697 | 5697 | \tcode{affine_on} adapts a sender into one that completes on |
5698 | | -the specified scheduler. If the algorithm determines that the adapted |
5699 | | -sender already completes on the correct scheduler it can avoid any |
5700 | | -scheduling operation. |
| 5698 | +the specified scheduler. |
| 5699 | +If the algorithm determines that the adapted sender already completes |
| 5700 | +on the correct scheduler it can avoid any scheduling operation. |
5701 | 5701 |
|
5702 | 5702 | \pnum |
5703 | 5703 | The name \tcode{affine_on} denotes a pipeable sender adaptor |
5704 | | -object. For subexpressions \tcode{sch} and \tcode{sndr}, if |
5705 | | -\tcode{decltype((sch))} does not satisfy \libconcept{scheduler}, or |
5706 | | -\tcode{decltype((sndr))} does not satisfy \libconcept{sender}, |
5707 | | -\tcode{affine_on(sndr, sch)} is ill-formed. |
| 5704 | +object. |
| 5705 | +For subexpressions \tcode{sch} and \tcode{sndr}, if \tcode{decltype((sch))} |
| 5706 | +does not satisfy \libconcept{scheduler}, or \tcode{decltype((sndr))} |
| 5707 | +does not satisfy \libconcept{sender}, \tcode{affine_on(sndr, sch)} |
| 5708 | +is ill-formed. |
5708 | 5709 |
|
5709 | 5710 | \pnum |
5710 | 5711 | Otherwise, the expression \tcode{affine_on(sndr, sch)} is |
|
5736 | 5737 | and let \tcode{OutSndr} be the type \tcode{decltype((out_sndr))}. |
5737 | 5738 | Let \tcode{out_rcvr} be a subexpression denoting a receiver that |
5738 | 5739 | has an environment of type \tcode{Env} such that \tcode{\libconcept{sender_in}<OutSndr, Env>} |
5739 | | -is \tcode{true}. Let \tcode{op} be an lvalue referring to |
5740 | | -the operation state that results from connecting \tcode{out_sndr} |
5741 | | -to \tcode{out_rcvr}. Calling \tcode{start(op)} will start \tcode{sndr} |
5742 | | -on the current execution agent and execute completion operations |
5743 | | -on \tcode{out_rcvr} on an execution agent of the execution resource |
5744 | | -associated with \tcode{sch}. If the current execution resource is |
5745 | | -the same as the execution resource associated with \tcode{sch}, the |
5746 | | -completion operation on \tcode{out_rcvr} may be called before |
5747 | | -\tcode{start(op)} completes. If scheduling onto \tcode{sch} fails, |
5748 | | -an error completion on \tcode{out_rcvr} shall be executed on an |
5749 | | -unspecified execution agent. |
| 5740 | +is \tcode{true}. |
| 5741 | +Let \tcode{op} be an lvalue referring to the operation state that |
| 5742 | +results from connecting \tcode{out_sndr} to \tcode{out_rcvr}. |
| 5743 | +Calling \tcode{start(op)} will start \tcode{sndr} on the current |
| 5744 | +execution agent and execute completion operations on \tcode{out_rcvr} |
| 5745 | +on an execution agent of the execution resource associated with |
| 5746 | +\tcode{sch}. |
| 5747 | +If the current execution resource is the same as the execution |
| 5748 | +resource associated with \tcode{sch}, the completion operation on |
| 5749 | +\tcode{out_rcvr} may be called before \tcode{start(op)} completes. |
| 5750 | +If scheduling onto \tcode{sch} fails, an error completion on |
| 5751 | +\tcode{out_rcvr} shall be executed on an unspecified execution |
| 5752 | +agent. |
5750 | 5753 |
|
5751 | 5754 | \rSec2[exec.inline.scheduler]{\tcode{execution::inline_scheduler}} |
5752 | 5755 |
|
|
5768 | 5771 |
|
5769 | 5772 | \pnum |
5770 | 5773 | \tcode{inline_scheduler} is a class that models |
5771 | | -\libconcept{scheduler}\iref{exec.sched}. All objects of type |
5772 | | -\tcode{inline_scheduler} are equal. |
| 5774 | +\libconcept{scheduler}\iref{exec.sched}. |
| 5775 | +All objects of type \tcode{inline_scheduler} are equal. |
5773 | 5776 |
|
5774 | 5777 | \pnum |
5775 | 5778 | \exposid{inline-sender} is an exposition-only type that satisfies |
5776 | | -\libconcept{sender}. The type |
5777 | | -\tcode{completion_signatures_of_t<\exposid{inline-sender}>} |
| 5779 | +\libconcept{sender}. |
| 5780 | +he type \tcode{completion_signatures_of_t<\exposid{inline-sender}>} |
5778 | 5781 | is \tcode{completion_signatures<set_value_t()>}. |
5779 | 5782 |
|
5780 | 5783 | \pnum |
|
5843 | 5846 |
|
5844 | 5847 | \pnum |
5845 | 5848 | \tcode{task_scheduler} is a class that models |
5846 | | -\libconcept{scheduler}\iref{exec.sched}. Given on object \tcode{s} |
5847 | | -of type \tcode{task_scheduler}, let \tcode{SCHED(s)} be the object |
5848 | | -owned by \tcode{s.\exposid{sch_}}. |
| 5849 | +\libconcept{scheduler}\iref{exec.sched}. |
| 5850 | +Given on object \tcode{s} of type \tcode{task_scheduler}, let |
| 5851 | +\tcode{SCHED(s)} be the object owned by \tcode{s.\exposid{sch_}}. |
5849 | 5852 |
|
5850 | 5853 | \begin{itemdecl} |
5851 | 5854 | template<class Sch, class Allocator = allocator<void>> |
|
5932 | 5935 | \pnum |
5933 | 5936 | Let \tcode{sch} be an object of type \tcode{task_scheduler} |
5934 | 5937 | and let \tcode{sndr} be an object of type \exposid{ts-sender} obtained |
5935 | | -from \tcode{schedule(sch)}. Then |
5936 | | -\tcode{get_completion_scheduler<set_value_t>(get_env(sndr)) == sch} |
5937 | | -is \tcode{true}. The object \tcode{SENDER(sndr)} is the sender |
5938 | | -object contained by \tcode{sndr} or an object move constructed from |
5939 | | -it. |
| 5938 | +from \tcode{schedule(sch)}. |
| 5939 | +Then \tcode{get_completion_scheduler<set_value_t>(get_env(sndr)) == sch} |
| 5940 | +is \tcode{true}. |
| 5941 | +The object \tcode{SENDER(sndr)} is the sender object contained by |
| 5942 | +\tcode{sndr} or an object move constructed from it. |
5940 | 5943 |
|
5941 | 5944 | \begin{itemdecl} |
5942 | 5945 | template<@\libconcept{receiver}@ Rcvr> |
|
5947 | 5950 | \effects |
5948 | 5951 | Let \tcode{r} be an object of a type that models \libconcept{receiver} |
5949 | 5952 | and whose completion handlers result in invoking the corresponding |
5950 | | -completion handlers of \tcode{rcvr} or copy thereof. Returns an |
5951 | | -object of type \tcode{\exposid{state}<Rcvr>} containing an operation |
5952 | | -state object initialized with \tcode{connect(SENDER(*this), |
| 5953 | +completion handlers of \tcode{rcvr} or copy thereof. |
| 5954 | +Returns an object of type \tcode{\exposid{state}<Rcvr>} containing |
| 5955 | +an operation state object initialized with \tcode{connect(SENDER(*this), |
5953 | 5956 | std::move(r))}. |
5954 | 5957 |
|
5955 | 5958 | \begin{codeblock} |
|
5983 | 5986 |
|
5984 | 5987 | \pnum |
5985 | 5988 | The \tcode{task} class template represents a sender that can |
5986 | | -be used as the return type of coroutines. The first template parameter |
5987 | | -\tcode{T} defines the type of the value completion datum |
5988 | | -\iref{exec.async.ops} if \tcode{T} is not \tcode{void}. Otherwise, |
5989 | | -there are no value completion datums. Inside coroutines returning |
5990 | | -\tcode{task<T, E>} the operand of \tcode{co_return} (if any) becomes |
5991 | | -the argument of \tcode{set_value}. The second template parameter |
5992 | | -\tcode{Environment} is used to customize the behavior of \tcode{task}. |
| 5989 | +be used as the return type of coroutines. |
| 5990 | +The first template parameter \tcode{T} defines the type of the value |
| 5991 | +completion datum \iref{exec.async.ops} if \tcode{T} is not \tcode{void}. |
| 5992 | +Otherwise, there are no value completion datums. |
| 5993 | +Inside coroutines returning \tcode{task<T, E>} the operand of |
| 5994 | +\tcode{co_return} (if any) becomes the argument of \tcode{set_value}. |
| 5995 | +The second template parameter \tcode{Environment} is used to customize |
| 5996 | +the behavior of \tcode{task}. |
5993 | 5997 |
|
5994 | 5998 | \rSec3[task.class]{Class template \tcode{task}} |
5995 | 5999 |
|
|
6028 | 6032 | \pnum |
6029 | 6033 | \tcode{task<T, E>} models \libconcept{sender}\iref{exec.snd} |
6030 | 6034 | if \tcode{T} is \tcode{void}, a reference type, or a \cv{}-unqualified |
6031 | | -non-array object type and \tcode{E} is a class type. Otherwise a program |
6032 | | -that instantiates the definition of \tcode{task<T, E>} is ill-formed. |
| 6035 | +non-array object type and \tcode{E} is a class type. |
| 6036 | +Otherwise a program that instantiates the definition of \tcode{task<T, E>} |
| 6037 | +is ill-formed. |
6033 | 6038 |
|
6034 | 6039 | \pnum |
6035 | 6040 | The nested types of \tcode{task} template specializations |
|
6297 | 6302 |
|
6298 | 6303 | \pnum |
6299 | 6304 | Let \tcode{prom} be an object of \tcode{promise_type} and let \tcode{tsk} be |
6300 | | -the \tcode{task} object created by \tcode{prom.get_return_object()}. The |
6301 | | -description below refers to objects \tcode{STATE(prom)}, |
| 6305 | +the \tcode{task} object created by \tcode{prom.get_return_object()}. |
| 6306 | +The description below refers to objects \tcode{STATE(prom)}, |
6302 | 6307 | \tcode{RCVR(prom)}, and \tcode{SCHED(prom)} associated |
6303 | 6308 | with \tcode{tsk} during evalutation of \tcode{task::\exposid{state}<Rcvr>::start} |
6304 | 6309 | for some receiver \tcode{Rcvr}. |
|
6325 | 6330 | \effects |
6326 | 6331 | If \tcode{Args} contains an element of type \tcode{allocator_arg_t} |
6327 | 6332 | then \exposid{alloc} is initialized with the corresponding next |
6328 | | -element of \tcode{args}. Otherwise, \exposid{alloc} is initialized |
6329 | | -with \tcode{allocator_type()}. |
| 6333 | +element of \tcode{args}. |
| 6334 | +Otherwise, \exposid{alloc} is initialized with \tcode{allocator_type()}. |
6330 | 6335 | \end{itemdescr} |
6331 | 6336 |
|
6332 | 6337 | \begin{itemdecl} |
|
6390 | 6395 | \pnum |
6391 | 6396 | \mandates |
6392 | 6397 | \tcode{std::move(err.error)} is convertible to exactly one of the |
6393 | | -\tcode{set_error_t} argument types of \tcode{error_types}. Let |
6394 | | -\tcode{Cerr} be that type. |
| 6398 | +\tcode{set_error_t} argument types of \tcode{error_types}. |
| 6399 | +Let \tcode{Cerr} be that type. |
6395 | 6400 |
|
6396 | 6401 | \pnum |
6397 | 6402 | \returns |
|
6475 | 6480 | \item For any other query \tcode{q} and arguments \tcode{a...} a |
6476 | 6481 | call to \tcode{env.query(q, a...)} returns |
6477 | 6482 | \tcode{STATE(*this).} \tcode{environment.query(q, a...)} if this expression |
6478 | | - is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}. Otherwise |
6479 | | - \tcode{env.query(q, a...)} is ill-formed. |
| 6483 | + is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}. |
| 6484 | + Otherwise \tcode{env.query(q, a...)} is ill-formed. |
6480 | 6485 | \end{itemize} |
6481 | 6486 | \end{itemdescr} |
6482 | 6487 |
|
|
6488 | 6493 | \begin{itemdescr} |
6489 | 6494 | \pnum |
6490 | 6495 | If there is no parameter with type \tcode{allocator_arg_t} then let |
6491 | | -\tcode{alloc} be \tcode{Allocator()}. Let \tcode{arg_next} be the |
6492 | | -parameter following the first \tcode{allocator_arg_t} parameter (if |
6493 | | -any) and let \tcode{alloc} be \tcode{Allocator(arg_next)}. Then |
6494 | | -\tcode{PAlloc} is \tcode{allocator_traits<Allocator>::template |
| 6496 | +\tcode{alloc} be \tcode{Allocator()}. |
| 6497 | +Let \tcode{arg_next} be the parameter following the first |
| 6498 | +\tcode{allocator_arg_t} parameter (if any) and let \tcode{alloc} |
| 6499 | +be \tcode{Allocator(arg_next)}. |
| 6500 | +Then \tcode{PAlloc} is \tcode{allocator_traits<Allocator>::template |
6495 | 6501 | re\-bind_alloc\brk{}<U>} where \tcode{U} is an unspecified type |
6496 | 6502 | whose size and alignment are both \tcode{__STDCPP_DEFAULT_NEW_ALIGNMENT__}. |
6497 | 6503 |
|
|
6508 | 6514 | \pnum |
6509 | 6515 | \effects |
6510 | 6516 | Initializes an allocator \tcode{palloc} of type \tcode{PAlloc} with |
6511 | | -\tcode{alloc}. Uses \tcode{palloc} to allocate storage for the |
| 6517 | +\tcode{alloc}. |
| 6518 | +Uses \tcode{palloc} to allocate storage for the |
6512 | 6519 | smallest array of \tcode{U} sufficient to provide storage for a |
6513 | 6520 | coroutine state of size \tcode{size}, and unspecified additional |
6514 | 6521 | state necessary to ensure that \tcode{operator delete} can later |
|
0 commit comments