From Jason Turner

[func.bind.bind]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpe0acjuvj/{from.md → to.md} +68 -56
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, the following names have the following
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
- - `Ti` is the iᵗʰ type in the template parameter pack `BoundArgs`,
9
- - `TiD` is the type `decay_t<Ti>`,
10
- - `ti` is the iᵗʰ argument in the function parameter pack `bound_args`,
11
- - `tid` is an lvalue of type `TiD` constructed from
12
- `std::forward<Ti>(ti)`,
13
- - `Uj` is the jᵗʰ deduced type of the `UnBoundArgs&&...` parameter of
14
  the forwarding call wrapper, and
15
- - `uj` is the jᵗʰ argument associated with `Uj`.
16
 
17
  ``` cpp
18
  template<class F, class... BoundArgs>
19
  unspecified bind(F&& f, BoundArgs&&... bound_args);
20
  ```
21
 
22
- *Requires:* `is_constructible<FD, F>::value` shall be `true`. For each
23
- `Ti` in `BoundArgs`, `is_constructible<TiD, Ti>::value` shall be `true`.
24
- *`INVOKE`*` (fd, w1, w2, ..., wN)` ([[func.require]]) shall be a valid
25
- expression for some values *w1, w2, ..., wN*, where
26
- `N == sizeof...(bound_args)`.
 
27
 
28
- *Returns:* A forwarding call wrapper `g` with a weak result
29
- type ([[func.require]]). The effect of `g(u1, u2, ..., uM)` shall be
30
- *`INVOKE`*`(fd, std::forward<V1>(v1), std::forward<V2>(v2), ..., std::forward<VN>(vN), result_of_t<FD `*`cv`*` & (V1, V2, ..., VN)>)`,
31
- where *`cv`* represents the *cv*-qualifiers of `g` and the values and
32
- types of the bound arguments `v1, v2, ..., vN` are determined as
33
- specified below. The copy constructor and move constructor of the
34
- forwarding call wrapper shall throw an exception if and only if the
35
- corresponding constructor of `FD` or of any of the types `TiD` throws an
36
- exception.
 
 
 
37
 
38
  *Throws:* Nothing unless the construction of `fd` or of one of the
39
- values `tid` throws an exception.
40
 
41
  *Remarks:* The return type shall satisfy the requirements of
42
- `MoveConstructible`. If all of `FD` and `TiD` satisfy the requirements
43
  of `CopyConstructible`, then the return type shall satisfy the
44
- requirements of `CopyConstructible`. This implies that all of `FD` and
45
- `TiD` are `MoveConstructible`.
 
 
46
 
47
  ``` cpp
48
  template<class R, class F, class... BoundArgs>
49
  unspecified bind(F&& f, BoundArgs&&... bound_args);
50
  ```
51
 
52
- *Requires:* `is_constructible<FD, F>::value` shall be `true`. For each
53
- `Ti` in `BoundArgs`, `is_constructible<TiD, Ti>::value` shall be `true`.
54
- *`INVOKE`*`(fd, w1, w2, ..., wN)` shall be a valid expression for some
55
- values *w1, w2, ..., wN*, where `N == sizeof...(bound_args)`.
 
 
56
 
57
- *Returns:* A forwarding call wrapper `g` with a nested type
58
- `result_type` defined as a synonym for `R`. The effect of
59
- `g(u1, u2, ..., uM)` shall be
60
- *`INVOKE`*`(fd, std::forward<V1>(v1), std::forward<V2>(v2), ..., std::forward<VN>(vN), R)`,
61
- where the values and types of the bound arguments `v1, v2, ..., vN` are
62
- determined as specified below. The copy constructor and move constructor
63
- of the forwarding call wrapper shall throw an exception if and only if
64
- the corresponding constructor of `FD` or of any of the types `TiD`
65
- throws an exception.
 
 
 
66
 
67
  *Throws:* Nothing unless the construction of `fd` or of one of the
68
- values `tid` throws an exception.
69
 
70
  *Remarks:* The return type shall satisfy the requirements of
71
- `MoveConstructible`. If all of `FD` and `TiD` satisfy the requirements
72
  of `CopyConstructible`, then the return type shall satisfy the
73
- requirements of `CopyConstructible`. This implies that all of `FD` and
74
- `TiD` are `MoveConstructible`.
75
 
76
- The values of the *bound arguments* `v1, v2, ..., vN` and their
77
- corresponding types `V1, V2, ..., VN` depend on the types `TiD` derived
78
- from the call to `bind` and the *cv*-qualifiers *cv* of the call wrapper
79
- `g` as follows:
80
 
81
- - if `TiD` is `reference_wrapper<T>`, the argument is `tid.get()` and
82
- its type `Vi` is `T&`;
83
- - if the value of `is_bind_expression<TiD>::value` is `true`, the
84
- argument is `tid(std::forward<Uj>({}uj)...)` and its type `Vi` is
85
- `result_of_t<TiD cv & (Uj&&...)>&&`;
86
- - if the value `j` of `is_placeholder<TiD>::value` is not zero, the
87
- argument is `std::forward<Uj>(uj)` and its type `Vi` is `Uj&&`;
88
- - otherwise, the value is `tid` and its type `Vi` is `TiD cv &`.
 
 
 
 
 
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