tmp/tmp8ofosy9g/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Closure objects <a id="exec.adapt.obj">[[exec.adapt.obj]]</a>
|
| 2 |
+
|
| 3 |
+
A *pipeable sender adaptor closure object* is a function object that
|
| 4 |
+
accepts one or more `sender` arguments and returns a `sender`. For a
|
| 5 |
+
pipeable sender adaptor closure object `c` and an expression `sndr` such
|
| 6 |
+
that `decltype((sndr))` models `sender`, the following expressions are
|
| 7 |
+
equivalent and yield a `sender`:
|
| 8 |
+
|
| 9 |
+
``` cpp
|
| 10 |
+
c(sndr)
|
| 11 |
+
sndr | c
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
Given an additional pipeable sender adaptor closure object `d`, the
|
| 15 |
+
expression `c | d` produces another pipeable sender adaptor closure
|
| 16 |
+
object `e`:
|
| 17 |
+
|
| 18 |
+
`e` is a perfect forwarding call wrapper [[func.require]] with the
|
| 19 |
+
following properties:
|
| 20 |
+
|
| 21 |
+
- Its target object is an object `d2` of type `decltype(auto(d))`
|
| 22 |
+
direct-non-list-initialized with `d`.
|
| 23 |
+
- It has one bound argument entity, an object `c2` of type
|
| 24 |
+
`decltype(auto(c))` direct-non-list-initialized with `c`.
|
| 25 |
+
- Its call pattern is `d2(c2(arg))`, where arg is the argument used in a
|
| 26 |
+
function call expression of `e`.
|
| 27 |
+
|
| 28 |
+
The expression `c | d` is well-formed if and only if the initializations
|
| 29 |
+
of the state entities [[func.def]] of `e` are all well-formed.
|
| 30 |
+
|
| 31 |
+
An object `t` of type `T` is a pipeable sender adaptor closure object if
|
| 32 |
+
`T` models `derived_from<sender_adaptor_closure<T>>`, `T` has no other
|
| 33 |
+
base classes of type `sender_adaptor_closure<U>` for any other type `U`,
|
| 34 |
+
and `T` does not satisfy `sender`.
|
| 35 |
+
|
| 36 |
+
The template parameter `D` for `sender_adaptor_closure` can be an
|
| 37 |
+
incomplete type. Before any expression of type cv `D` appears as an
|
| 38 |
+
operand to the `|` operator, `D` shall be complete and model
|
| 39 |
+
`derived_from<sender_adaptor_closure<D>>`. The behavior of an expression
|
| 40 |
+
involving an object of type cv `D` as an operand to the `|` operator is
|
| 41 |
+
undefined if overload resolution selects a program-defined `operator|`
|
| 42 |
+
function.
|
| 43 |
+
|
| 44 |
+
A *pipeable sender adaptor object* is a customization point object that
|
| 45 |
+
accepts a `sender` as its first argument and returns a `sender`. If a
|
| 46 |
+
pipeable sender adaptor object accepts only one argument, then it is a
|
| 47 |
+
pipeable sender adaptor closure object.
|
| 48 |
+
|
| 49 |
+
If a pipeable sender adaptor object adaptor accepts more than one
|
| 50 |
+
argument, then let `sndr` be an expression such that `decltype((sndr))`
|
| 51 |
+
models `sender`, let `args...` be arguments such that
|
| 52 |
+
`adaptor(sndr, args...)` is a well-formed expression as specified below,
|
| 53 |
+
and let `BoundArgs` be a pack that denotes `decltype(auto(args))...`.
|
| 54 |
+
The expression `adaptor(args...)` produces a pipeable sender adaptor
|
| 55 |
+
closure object `f` that is a perfect forwarding call wrapper with the
|
| 56 |
+
following properties:
|
| 57 |
+
|
| 58 |
+
- Its target object is a copy of adaptor.
|
| 59 |
+
- Its bound argument entities `bound_args` consist of objects of types
|
| 60 |
+
`BoundArgs...` direct-non-list-initialized with
|
| 61 |
+
`std::forward<decltype((args))>(args)...`, respectively.
|
| 62 |
+
- Its call pattern is `adaptor(rcvr, bound_args...)`, where `rcvr` is
|
| 63 |
+
the argument used in a function call expression of `f`.
|
| 64 |
+
|
| 65 |
+
The expression `adaptor(args...)` is well-formed if and only if the
|
| 66 |
+
initializations of the bound argument entities of the result, as
|
| 67 |
+
specified above, are all well-formed.
|
| 68 |
+
|