tmp/tmpe0acjuvj/{from.md → to.md}
RENAMED
|
@@ -1,89 +1,101 @@
|
|
| 1 |
#### Function template `bind` <a id="func.bind.bind">[[func.bind.bind]]</a>
|
| 2 |
|
| 3 |
-
In the text that follows
|
| 4 |
-
meanings:
|
| 5 |
|
| 6 |
- `FD` is the type `decay_t<F>`,
|
| 7 |
- `fd` is an lvalue of type `FD` constructed from `std::forward<F>(f)`,
|
| 8 |
-
- `
|
| 9 |
-
- `
|
| 10 |
-
- `
|
| 11 |
-
- `
|
| 12 |
-
`std::forward<
|
| 13 |
-
- `
|
| 14 |
the forwarding call wrapper, and
|
| 15 |
-
- `
|
| 16 |
|
| 17 |
``` cpp
|
| 18 |
template<class F, class... BoundArgs>
|
| 19 |
unspecified bind(F&& f, BoundArgs&&... bound_args);
|
| 20 |
```
|
| 21 |
|
| 22 |
-
*Requires:* `
|
| 23 |
-
|
| 24 |
-
*
|
| 25 |
-
expression for some values
|
| 26 |
-
`
|
|
|
|
| 27 |
|
| 28 |
-
*Returns:* A forwarding call wrapper `g`
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
*Throws:* Nothing unless the construction of `fd` or of one of the
|
| 39 |
-
values `
|
| 40 |
|
| 41 |
*Remarks:* The return type shall satisfy the requirements of
|
| 42 |
-
`MoveConstructible`. If all of `FD` and `
|
| 43 |
of `CopyConstructible`, then the return type shall satisfy the
|
| 44 |
-
requirements of `CopyConstructible`.
|
| 45 |
-
|
|
|
|
|
|
|
| 46 |
|
| 47 |
``` cpp
|
| 48 |
template<class R, class F, class... BoundArgs>
|
| 49 |
unspecified bind(F&& f, BoundArgs&&... bound_args);
|
| 50 |
```
|
| 51 |
|
| 52 |
-
*Requires:* `
|
| 53 |
-
|
| 54 |
-
*
|
| 55 |
-
values
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
*Returns:* A forwarding call wrapper `g`
|
| 58 |
-
`
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
the
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
*Throws:* Nothing unless the construction of `fd` or of one of the
|
| 68 |
-
values `
|
| 69 |
|
| 70 |
*Remarks:* The return type shall satisfy the requirements of
|
| 71 |
-
`MoveConstructible`. If all of `FD` and `
|
| 72 |
of `CopyConstructible`, then the return type shall satisfy the
|
| 73 |
-
requirements of `CopyConstructible`.
|
| 74 |
-
`TiD` are `MoveConstructible`.
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
from the call to `bind` and the *cv*-qualifiers *cv* of the call wrapper
|
| 79 |
-
`g` as follows:
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
- if
|
| 87 |
-
|
| 88 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
|
|
|
| 1 |
#### Function template `bind` <a id="func.bind.bind">[[func.bind.bind]]</a>
|
| 2 |
|
| 3 |
+
In the text that follows:
|
|
|
|
| 4 |
|
| 5 |
- `FD` is the type `decay_t<F>`,
|
| 6 |
- `fd` is an lvalue of type `FD` constructed from `std::forward<F>(f)`,
|
| 7 |
+
- `Tᵢ` is the iᵗʰ type in the template parameter pack `BoundArgs`,
|
| 8 |
+
- `TDᵢ` is the type `decay_t<Tᵢ>`,
|
| 9 |
+
- `tᵢ` is the iᵗʰ argument in the function parameter pack `bound_args`,
|
| 10 |
+
- `tdᵢ` is an lvalue of type `TDᵢ` constructed from
|
| 11 |
+
`std::forward<Tᵢ>(tᵢ)`,
|
| 12 |
+
- `Uⱼ` is the jᵗʰ deduced type of the `UnBoundArgs&&...` parameter of
|
| 13 |
the forwarding call wrapper, and
|
| 14 |
+
- `uⱼ` is the jᵗʰ argument associated with `Uⱼ`.
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
template<class F, class... BoundArgs>
|
| 18 |
unspecified bind(F&& f, BoundArgs&&... bound_args);
|
| 19 |
```
|
| 20 |
|
| 21 |
+
*Requires:* `is_constructible_v<FD, F>` shall be `true`. For each `Tᵢ`
|
| 22 |
+
in `BoundArgs`, `is_constructible_v<``TDᵢ``, ``Tᵢ``>` shall be `true`.
|
| 23 |
+
*INVOKE*(fd, w₁, w₂, …, $w_N$) ([[func.require]]) shall be a valid
|
| 24 |
+
expression for some values `w₁`, `w₂`, …, `w_N`, where N has the value
|
| 25 |
+
`sizeof...(bound_args)`. The cv-qualifiers cv of the call wrapper `g`,
|
| 26 |
+
as specified below, shall be neither `volatile` nor `const volatile`.
|
| 27 |
|
| 28 |
+
*Returns:* A forwarding call wrapper `g` ([[func.require]]). The effect
|
| 29 |
+
of `g(``u₁``, ``u₂``, …, ``u_M``)` shall be
|
| 30 |
+
|
| 31 |
+
``` cpp
|
| 32 |
+
INVOKE(fd, std::forward<$V_1$>($v_1$), std::forward<$V_2$>($v_2$), … , std::forward<$V_N$>($v_N$))
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
where the values and types of the bound arguments `v₁`, `v₂`, …, `v_N`
|
| 36 |
+
are determined as specified below. The copy constructor and move
|
| 37 |
+
constructor of the forwarding call wrapper shall throw an exception if
|
| 38 |
+
and only if the corresponding constructor of `FD` or of any of the types
|
| 39 |
+
`TDᵢ` throws an exception.
|
| 40 |
|
| 41 |
*Throws:* Nothing unless the construction of `fd` or of one of the
|
| 42 |
+
values `tdᵢ` throws an exception.
|
| 43 |
|
| 44 |
*Remarks:* The return type shall satisfy the requirements of
|
| 45 |
+
`MoveConstructible`. If all of `FD` and `TDᵢ` satisfy the requirements
|
| 46 |
of `CopyConstructible`, then the return type shall satisfy the
|
| 47 |
+
requirements of `CopyConstructible`.
|
| 48 |
+
|
| 49 |
+
[*Note 1*: This implies that all of `FD` and `TDᵢ` are
|
| 50 |
+
`MoveConstructible`. — *end note*]
|
| 51 |
|
| 52 |
``` cpp
|
| 53 |
template<class R, class F, class... BoundArgs>
|
| 54 |
unspecified bind(F&& f, BoundArgs&&... bound_args);
|
| 55 |
```
|
| 56 |
|
| 57 |
+
*Requires:* `is_constructible_v<FD, F>` shall be `true`. For each `Tᵢ`
|
| 58 |
+
in `BoundArgs`, `is_constructible_v<``TDᵢ``, ``Tᵢ``>` shall be `true`.
|
| 59 |
+
*INVOKE*(fd, w₁, w₂, …, $w_N$) shall be a valid expression for some
|
| 60 |
+
values `w₁`, `w₂`, …, `w_N`, where N has the value
|
| 61 |
+
`sizeof...(bound_args)`. The cv-qualifiers cv of the call wrapper `g`,
|
| 62 |
+
as specified below, shall be neither `volatile` nor `const volatile`.
|
| 63 |
|
| 64 |
+
*Returns:* A forwarding call wrapper `g` ([[func.require]]). The effect
|
| 65 |
+
of `g(``u₁``, ``u₂``, …, ``u_M``)` shall be
|
| 66 |
+
|
| 67 |
+
``` cpp
|
| 68 |
+
INVOKE<R>(fd, std::forward<$V_1$>($v_1$), std::forward<$V_2$>($v_2$), … , std::forward<$V_N$>($v_N$))
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
where the values and types of the bound arguments `v₁`, `v₂`, …, `v_N`
|
| 72 |
+
are determined as specified below. The copy constructor and move
|
| 73 |
+
constructor of the forwarding call wrapper shall throw an exception if
|
| 74 |
+
and only if the corresponding constructor of `FD` or of any of the types
|
| 75 |
+
`TDᵢ` throws an exception.
|
| 76 |
|
| 77 |
*Throws:* Nothing unless the construction of `fd` or of one of the
|
| 78 |
+
values `tdᵢ` throws an exception.
|
| 79 |
|
| 80 |
*Remarks:* The return type shall satisfy the requirements of
|
| 81 |
+
`MoveConstructible`. If all of `FD` and `TDᵢ` satisfy the requirements
|
| 82 |
of `CopyConstructible`, then the return type shall satisfy the
|
| 83 |
+
requirements of `CopyConstructible`.
|
|
|
|
| 84 |
|
| 85 |
+
[*Note 2*: This implies that all of `FD` and `TDᵢ` are
|
| 86 |
+
`MoveConstructible`. — *end note*]
|
|
|
|
|
|
|
| 87 |
|
| 88 |
+
The values of the *bound arguments* `v₁`, `v₂`, …, `v_N` and their
|
| 89 |
+
corresponding types `V₁`, `V₂`, …, `V_N` depend on the types `TDᵢ`
|
| 90 |
+
derived from the call to `bind` and the cv-qualifiers cv of the call
|
| 91 |
+
wrapper `g` as follows:
|
| 92 |
+
|
| 93 |
+
- if `TDᵢ` is `reference_wrapper<T>`, the argument is `tdᵢ.get()` and
|
| 94 |
+
its type `Vᵢ` is `T&`;
|
| 95 |
+
- if the value of `is_bind_expression_v<TDᵢ>` is `true`, the argument is
|
| 96 |
+
`tdᵢ(std::forward<Uⱼ>(uⱼ)...)` and its type `Vᵢ` is
|
| 97 |
+
`invoke_result_t<TDᵢ cv &, Uⱼ...>&&`;
|
| 98 |
+
- if the value `j` of `is_placeholder_v<TDᵢ>` is not zero, the argument
|
| 99 |
+
is `std::forward<Uⱼ>(uⱼ)` and its type `Vᵢ` is `Uⱼ&&`;
|
| 100 |
+
- otherwise, the value is `tdᵢ` and its type `Vᵢ` is `TDᵢ cv &`.
|
| 101 |
|