tmp/tmpbhkv5631/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### `execution::stopped_as_error` <a id="exec.stopped.err">[[exec.stopped.err]]</a>
|
| 2 |
+
|
| 3 |
+
`stopped_as_error` maps an input sender’s stopped completion operation
|
| 4 |
+
into an error completion operation as a custom error type. The result is
|
| 5 |
+
a sender that never completes with stopped, reporting cancellation by
|
| 6 |
+
completing with an error.
|
| 7 |
+
|
| 8 |
+
The name `stopped_as_error` denotes a pipeable sender adaptor object.
|
| 9 |
+
For some subexpressions `sndr` and `err`, let `Sndr` be
|
| 10 |
+
`decltype((sndr))` and let `Err` be `decltype((err))`. If the type
|
| 11 |
+
`Sndr` does not satisfy `sender` or if the type `Err` does not satisfy
|
| 12 |
+
`movable-value`, `stopped_as_error(sndr, err)` is ill-formed. Otherwise,
|
| 13 |
+
the expression `stopped_as_error(sndr, err)` is expression-equivalent
|
| 14 |
+
to:
|
| 15 |
+
|
| 16 |
+
``` cpp
|
| 17 |
+
transform_sender(get-domain-early(sndr), make-sender(stopped_as_error, err, sndr))
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
except that `sndr` is only evaluated once.
|
| 21 |
+
|
| 22 |
+
Let `sndr` and `env` be subexpressions such that `Sndr` is
|
| 23 |
+
`decltype((sndr))` and `Env` is `decltype((env))`. If
|
| 24 |
+
`sender-for<Sndr, stopped_as_error_t>` is `false`, then the expression
|
| 25 |
+
`stopped_as_error.transform_sender(sndr, env)` is ill-formed; otherwise,
|
| 26 |
+
it is equivalent to:
|
| 27 |
+
|
| 28 |
+
``` cpp
|
| 29 |
+
auto&& [_, err, child] = sndr;
|
| 30 |
+
using E = decltype(auto(err));
|
| 31 |
+
return let_stopped(
|
| 32 |
+
std::forward_like<Sndr>(child),
|
| 33 |
+
[err = std::forward_like<Sndr>(err)]() mutable noexcept(is_nothrow_move_constructible_v<E>) {
|
| 34 |
+
return just_error(std::move(err));
|
| 35 |
+
});
|
| 36 |
+
```
|
| 37 |
+
|