tmp/tmpnsl9t_jl/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### `execution::affine_on` <a id="exec.affine.on">[[exec.affine.on]]</a>
|
| 2 |
+
|
| 3 |
+
`affine_on` adapts a sender into one that completes on the specified
|
| 4 |
+
scheduler. If the algorithm determines that the adapted sender already
|
| 5 |
+
completes on the correct scheduler it can avoid any scheduling
|
| 6 |
+
operation.
|
| 7 |
+
|
| 8 |
+
The name `affine_on` denotes a pipeable sender adaptor object. For
|
| 9 |
+
subexpressions `sch` and `sndr`, if `decltype((sch))` does not satisfy
|
| 10 |
+
`scheduler`, or `decltype((sndr))` does not satisfy `sender`,
|
| 11 |
+
`affine_on(sndr, sch)` is ill-formed.
|
| 12 |
+
|
| 13 |
+
Otherwise, the expression `affine_on(sndr, sch)` is
|
| 14 |
+
expression-equivalent to:
|
| 15 |
+
|
| 16 |
+
``` cpp
|
| 17 |
+
transform_sender(get-domain-early(sndr), make-sender(affine_on, sch, sndr))
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
except that `sndr` is evaluated only once.
|
| 21 |
+
|
| 22 |
+
The exposition-only class template *`impls-for`* [[exec.snd.expos]] is
|
| 23 |
+
specialized for `affine_on_t` as follows:
|
| 24 |
+
|
| 25 |
+
``` cpp
|
| 26 |
+
namespace std::execution {
|
| 27 |
+
template<>
|
| 28 |
+
struct impls-for<affine_on_t> : default-impls {
|
| 29 |
+
static constexpr auto get-attrs =
|
| 30 |
+
[](const auto& data, const auto& child) noexcept -> decltype(auto) {
|
| 31 |
+
return JOIN-ENV(SCHED-ATTRS(data), FWD-ENV(get_env(child)));
|
| 32 |
+
};
|
| 33 |
+
};
|
| 34 |
+
}
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
Let `out_sndr` be a subexpression denoting a sender returned from
|
| 38 |
+
`affine_on(sndr, sch)` or one equal to such, and let `OutSndr` be the
|
| 39 |
+
type `decltype((out_sndr))`. Let `out_rcvr` be a subexpression denoting
|
| 40 |
+
a receiver that has an environment of type `Env` such that
|
| 41 |
+
`sender_in<OutSndr, Env>` is `true`. Let `op` be an lvalue referring to
|
| 42 |
+
the operation state that results from connecting `out_sndr` to
|
| 43 |
+
`out_rcvr`. Calling `start(op)` will start `sndr` on the current
|
| 44 |
+
execution agent and execute completion operations on `out_rcvr` on an
|
| 45 |
+
execution agent of the execution resource associated with `sch`. If the
|
| 46 |
+
current execution resource is the same as the execution resource
|
| 47 |
+
associated with `sch`, the completion operation on `out_rcvr` may be
|
| 48 |
+
called before `start(op)` completes. If scheduling onto `sch` fails, an
|
| 49 |
+
error completion on `out_rcvr` shall be executed on an unspecified
|
| 50 |
+
execution agent.
|
| 51 |
+
|