|
2458 | 2458 |
|
2459 | 2459 | \mandates
|
2460 | 2460 | \tcode{\libconcept{sender}<Sndr> \&\& \libconcept{receiver}<Rcvr>} is \tcode{true}.
|
2461 |
| - |
2462 |
| - |
| 2461 | + |
| 2462 | +\rSec2[exec.factories]{Sender factories} |
| 2463 | + |
| 2464 | +\rSec3[exec.schedule]{\tcode{execution::schedule}} |
| 2465 | + |
| 2466 | +\pnum |
| 2467 | +\tcode{schedule} obtains a schedule sender\iref{exec.async.ops} |
| 2468 | +from a scheduler. |
| 2469 | + |
| 2470 | +\pnum |
| 2471 | +The name \tcode{schedule} denotes a customization point object. |
| 2472 | +For a subexpression \tcode{sch}, |
| 2473 | +the expression \tcode{schedule(sch)} is expression-equivalent to |
| 2474 | +\tcode{sch.schedule()}. |
| 2475 | + |
| 2476 | +\pnum |
| 2477 | +\mandates |
| 2478 | +The type of \tcode{sch.schedule()} satisfies \libconcept{sender}. |
| 2479 | + |
| 2480 | +\pnum |
| 2481 | +If the expression |
| 2482 | +\begin{codeblock} |
| 2483 | +get_completion_scheduler<set_value_t>(get_env(sch.schedule())) == sch |
| 2484 | +\end{codeblock} |
| 2485 | +is ill-formed or evaluates to \tcode{false}, |
| 2486 | +the behavior of calling \tcode{schedule(sch)} is undefined. |
| 2487 | + |
| 2488 | +\rSec3[exec.just]{\tcode{execution::just}, \tcode{execution::just_error}, \tcode{execution::just_stopped}} |
| 2489 | + |
| 2490 | +\pnum |
| 2491 | +\tcode{just}, \tcode{just_error}, and \tcode{just_stopped} are sender factories |
| 2492 | +whose asynchronous operations complete synchronously in their start operation |
| 2493 | +with a value completion operation, |
| 2494 | +an error completion operation, or |
| 2495 | +a stopped completion operation, respectively. |
| 2496 | + |
| 2497 | +\pnum |
| 2498 | +The names \tcode{just}, \tcode{just_error}, and \tcode{just_stopped} denote |
| 2499 | +customization point objects. |
| 2500 | +Let \exposid{just-cpo} be one of |
| 2501 | +\tcode{just}, \tcode{just_error}, or \tcode{just_stopped}. |
| 2502 | +For a pack of subexpressions \tcode{ts}, |
| 2503 | +let \tcode{Ts} be the pack of types \tcode{decltype((ts))}. |
| 2504 | +The expression \tcode{\exposid{just-cpo}(ts...)} is ill-formed if |
| 2505 | +\begin{itemize} |
| 2506 | +\item |
| 2507 | +\tcode{(\exposid{movable-value}<Ts> \&\&...)} is \tcode{false}, or |
| 2508 | +\item |
| 2509 | +\exposid{just-cpo} is \tcode{just_error} and |
| 2510 | +\tcode{sizeof...(ts) == 1} is \tcode{false}, or |
| 2511 | +\item |
| 2512 | +\exposid{just-cpo} is \tcode{just_stopped} and |
| 2513 | +\tcode{sizeof...(ts) == 0} is \tcode{false}. |
| 2514 | +\end{itemize} |
| 2515 | + |
| 2516 | +Otherwise, it is expression-equivalent to |
| 2517 | +\tcode{\exposid{make-sender}(\exposid{just-cpo}, \exposid{product-type}{ts...})}. |
| 2518 | + |
| 2519 | +For \tcode{just}, \tcode{just_error}, and \tcode{just_stopped}, |
| 2520 | +let \exposid{set-cpo} be |
| 2521 | +\tcode{set_value}, \tcode{set_error}, and \tcode{set_stopped}, respectively. |
| 2522 | +The exposition-only class template \exposid{impls-for}\iref{exec.snd.general} |
| 2523 | +is specialized for \exposid{just-cpo} as follows: |
| 2524 | +\begin{codeblock} |
| 2525 | +namespace std::execution { |
| 2526 | + template<> |
| 2527 | + struct @\exposid{impls-for<}@@\exposid{decayed-typeof}@<@\exposid{just-cpo}@>> : @\exposid{default-impls}@ { |
| 2528 | + static constexpr auto start = |
| 2529 | + [](auto& state, auto& rcvr) noexcept -> void { |
| 2530 | + auto& [...ts] = state; |
| 2531 | + @\exposid{set-cpo}@(std::move(rcvr), std::move(ts)...); |
| 2532 | + }; |
| 2533 | + }; |
| 2534 | +} |
| 2535 | +\end{codeblock} |
| 2536 | + |
| 2537 | +\rSec3[exec.read.env]{\tcode{execution::read_env}} |
| 2538 | + |
| 2539 | + |
2463 | 2540 | \rSec1[exec.util]{Sender/receiver utilities}
|
2464 | 2541 |
|
2465 | 2542 | \rSec1[exec.ctx]{Execution contexts}
|
|
0 commit comments