tmp/tmpagqgwfow/{from.md → to.md}
RENAMED
|
@@ -1,35 +1,38 @@
|
|
| 1 |
### Requirements <a id="func.require">[[func.require]]</a>
|
| 2 |
|
| 3 |
Define `INVOKE(f, t₁, t₂, …, t_N)` as follows:
|
| 4 |
|
| 5 |
- `(t₁.*f)(t₂, …, t_N)` when `f` is a pointer to a member function of a
|
| 6 |
-
class `T` and `
|
| 7 |
-
`true`;
|
| 8 |
- `(t₁.get().*f)(t₂, …, t_N)` when `f` is a pointer to a member function
|
| 9 |
of a class `T` and `remove_cvref_t<decltype(t₁)>` is a specialization
|
| 10 |
of `reference_wrapper`;
|
| 11 |
- `((*t₁).*f)(t₂, …, t_N)` when `f` is a pointer to a member function of
|
| 12 |
a class `T` and `t₁` does not satisfy the previous two items;
|
| 13 |
-
- `t₁.*f` when
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
class `T` and `remove_cvref_t<decltype(t₁)>` is a specialization of
|
| 17 |
`reference_wrapper`;
|
| 18 |
-
- `(*t₁).*f` when
|
| 19 |
-
|
| 20 |
- `f(t₁, t₂, …, t_N)` in all other cases.
|
| 21 |
|
| 22 |
Define `INVOKE<R>(f, t₁, t₂, …, t_N)` as
|
| 23 |
`static_cast<void>(INVOKE(f, t₁, t₂, …, t_N))` if `R` is cv `void`,
|
| 24 |
-
otherwise `INVOKE(f, t₁, t₂, …, t_N)` implicitly converted to `R`.
|
|
|
|
|
|
|
| 25 |
|
| 26 |
Every call wrapper [[func.def]] meets the *Cpp17MoveConstructible* and
|
| 27 |
*Cpp17Destructible* requirements. An *argument forwarding call wrapper*
|
| 28 |
is a call wrapper that can be called with an arbitrary argument list and
|
| 29 |
-
delivers the arguments to the
|
| 30 |
-
|
| 31 |
lvalue arguments as lvalue references.
|
| 32 |
|
| 33 |
[*Note 1*:
|
| 34 |
|
| 35 |
In a typical implementation, argument forwarding call wrappers have an
|
|
@@ -50,11 +53,11 @@ and as cv `T&&` otherwise, where cv represents the cv-qualifiers of the
|
|
| 50 |
call wrapper and where cv shall be neither `volatile` nor
|
| 51 |
`const volatile`.
|
| 52 |
|
| 53 |
A *call pattern* defines the semantics of invoking a perfect forwarding
|
| 54 |
call wrapper. A postfix call performed on a perfect forwarding call
|
| 55 |
-
wrapper is expression-equivalent [[defns.expression
|
| 56 |
expression `e` determined from its call pattern `cp` by replacing all
|
| 57 |
occurrences of the arguments of the call wrapper and its state entities
|
| 58 |
with references as described in the corresponding forwarding steps.
|
| 59 |
|
| 60 |
A *simple call wrapper* is a perfect forwarding call wrapper that meets
|
|
|
|
| 1 |
### Requirements <a id="func.require">[[func.require]]</a>
|
| 2 |
|
| 3 |
Define `INVOKE(f, t₁, t₂, …, t_N)` as follows:
|
| 4 |
|
| 5 |
- `(t₁.*f)(t₂, …, t_N)` when `f` is a pointer to a member function of a
|
| 6 |
+
class `T` and `is_same_v<T, remove_cvref_t<decltype(t1)>> ||`
|
| 7 |
+
`is_base_of_v<T, remove_cvref_t<decltype(t₁)>>` is `true`;
|
| 8 |
- `(t₁.get().*f)(t₂, …, t_N)` when `f` is a pointer to a member function
|
| 9 |
of a class `T` and `remove_cvref_t<decltype(t₁)>` is a specialization
|
| 10 |
of `reference_wrapper`;
|
| 11 |
- `((*t₁).*f)(t₂, …, t_N)` when `f` is a pointer to a member function of
|
| 12 |
a class `T` and `t₁` does not satisfy the previous two items;
|
| 13 |
+
- `t₁.*f` when N = 1 and `f` is a pointer to data member of a class `T`
|
| 14 |
+
and `is_same_v<T, remove_cvref_t<decltype(t1)>> ||`
|
| 15 |
+
`is_base_of_v<T, remove_cvref_t<decltype(t₁)>>` is `true`;
|
| 16 |
+
- `t₁.get().*f` when N = 1 and `f` is a pointer to data member of a
|
| 17 |
class `T` and `remove_cvref_t<decltype(t₁)>` is a specialization of
|
| 18 |
`reference_wrapper`;
|
| 19 |
+
- `(*t₁).*f` when N = 1 and `f` is a pointer to data member of a class
|
| 20 |
+
`T` and `t₁` does not satisfy the previous two items;
|
| 21 |
- `f(t₁, t₂, …, t_N)` in all other cases.
|
| 22 |
|
| 23 |
Define `INVOKE<R>(f, t₁, t₂, …, t_N)` as
|
| 24 |
`static_cast<void>(INVOKE(f, t₁, t₂, …, t_N))` if `R` is cv `void`,
|
| 25 |
+
otherwise `INVOKE(f, t₁, t₂, …, t_N)` implicitly converted to `R`. If
|
| 26 |
+
`reference_converts_from_temporary_v<R, decltype(INVOKE(f, t₁, t₂, …, t_N))>`
|
| 27 |
+
is `true`, `INVOKE<R>(f, t₁, t₂, …, t_N)` is ill-formed.
|
| 28 |
|
| 29 |
Every call wrapper [[func.def]] meets the *Cpp17MoveConstructible* and
|
| 30 |
*Cpp17Destructible* requirements. An *argument forwarding call wrapper*
|
| 31 |
is a call wrapper that can be called with an arbitrary argument list and
|
| 32 |
+
delivers the arguments to the target object as references. This
|
| 33 |
+
forwarding step delivers rvalue arguments as rvalue references and
|
| 34 |
lvalue arguments as lvalue references.
|
| 35 |
|
| 36 |
[*Note 1*:
|
| 37 |
|
| 38 |
In a typical implementation, argument forwarding call wrappers have an
|
|
|
|
| 53 |
call wrapper and where cv shall be neither `volatile` nor
|
| 54 |
`const volatile`.
|
| 55 |
|
| 56 |
A *call pattern* defines the semantics of invoking a perfect forwarding
|
| 57 |
call wrapper. A postfix call performed on a perfect forwarding call
|
| 58 |
+
wrapper is expression-equivalent [[defns.expression.equivalent]] to an
|
| 59 |
expression `e` determined from its call pattern `cp` by replacing all
|
| 60 |
occurrences of the arguments of the call wrapper and its state entities
|
| 61 |
with references as described in the corresponding forwarding steps.
|
| 62 |
|
| 63 |
A *simple call wrapper* is a perfect forwarding call wrapper that meets
|