From Jason Turner

[func.require]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpoykdzdcg/{from.md → to.md} +30 -34
tmp/tmpoykdzdcg/{from.md → to.md} RENAMED
@@ -1,50 +1,46 @@
1
  ### Requirements <a id="func.require">[[func.require]]</a>
2
 
3
  Define `INVOKE(f, t1, t2, ..., tN)` as follows:
4
 
5
  - `(t1.*f)(t2, ..., tN)` when `f` is a pointer to a member function of a
6
- class `T` and `t1` is an object of type `T` or a reference to an
7
- object of type `T` or a reference to an object of a type derived from
8
- `T`;
 
9
  - `((*t1).*f)(t2, ..., tN)` when `f` is a pointer to a member function
10
- of a class `T` and `t1` is not one of the types described in the
11
- previous item;
12
- - `t1.*f` when `N == 1` and `f` is a pointer to member data of a class
13
- `T` and `t1` is an object of type `T` or a reference to an object of
14
- type `T` or a reference to an object of a type derived from `T`;
15
- - `(*t1).*f` when `N == 1` and `f` is a pointer to member data of a
16
- class `T` and `t1` is not one of the types described in the previous
17
- item;
18
  - `f(t1, t2, ..., tN)` in all other cases.
19
 
20
- Define `INVOKE(f, t1, t2, ..., tN, R)` as `INVOKE(f, t1, t2, ..., tN)`
21
- implicitly converted to `R`.
22
-
23
- If a call wrapper ([[func.def]]) has a *weak result type* the type of
24
- its member type `result_type` is based on the type `T` of the wrapper’s
25
- target object ([[func.def]]):
26
-
27
- - if `T` is a pointer to function type, `result_type` shall be a synonym
28
- for the return type of `T`;
29
- - if `T` is a pointer to member function, `result_type` shall be a
30
- synonym for the return type of `T`;
31
- - if `T` is a class type with a member type `result_type`, then
32
- `result_type` shall be a synonym for `T::result_type`;
33
- - otherwise `result_type` shall not be defined.
34
 
35
  Every call wrapper ([[func.def]]) shall be `MoveConstructible`. A
36
- *simple call wrapper* is a call wrapper that is `CopyConstructible` and
37
- `CopyAssignable` and whose copy constructor, move constructor, and
38
- assignment operator do not throw exceptions. A *forwarding call wrapper*
39
- is a call wrapper that can be called with an arbitrary argument list and
40
- delivers the arguments to the wrapped callable object as references.
41
- This forwarding step shall ensure that rvalue arguments are delivered as
42
- rvalue-references and lvalue arguments are delivered as
43
- lvalue-references. In a typical implementation forwarding call wrappers
44
- have an overloaded function call operator of the form
 
 
 
 
45
 
46
  ``` cpp
47
  template<class... UnBoundArgs>
48
  R operator()(UnBoundArgs&&... unbound_args) cv-qual;
49
  ```
50
 
 
 
 
1
  ### Requirements <a id="func.require">[[func.require]]</a>
2
 
3
  Define `INVOKE(f, t1, t2, ..., tN)` as follows:
4
 
5
  - `(t1.*f)(t2, ..., tN)` when `f` is a pointer to a member function of a
6
+ class `T` and `is_base_of_v<T, decay_t<decltype(t1)>>` is `true`;
7
+ - `(t1.get().*f)(t2, ..., tN)` when `f` is a pointer to a member
8
+ function of a class `T` and `decay_t<decltype(t1)>` is a
9
+ specialization of `reference_wrapper`;
10
  - `((*t1).*f)(t2, ..., tN)` when `f` is a pointer to a member function
11
+ of a class `T` and `t1` does not satisfy the previous two items;
12
+ - `t1.*f` when `N == 1` and `f` is a pointer to data member of a class
13
+ `T` and `is_base_of_v<T, decay_t<decltype(t1)>>` is `true`;
14
+ - `t1.get().*f` when `N == 1` and `f` is a pointer to data member of a
15
+ class `T` and `decay_t<decltype(t1)>` is a specialization of
16
+ `reference_wrapper`;
17
+ - `(*t1).*f` when `N == 1` and `f` is a pointer to data member of a
18
+ class `T` and `t1` does not satisfy the previous two items;
19
  - `f(t1, t2, ..., tN)` in all other cases.
20
 
21
+ Define `INVOKE<R>(f, t1, t2, ..., tN)` as
22
+ `static_cast<void>(INVOKE(f, t1, t2, ..., tN))` if `R` is cv `void`,
23
+ otherwise `INVOKE(f, t1, t2, ..., tN)` implicitly converted to `R`.
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  Every call wrapper ([[func.def]]) shall be `MoveConstructible`. A
26
+ *forwarding call wrapper* is a call wrapper that can be called with an
27
+ arbitrary argument list and delivers the arguments to the wrapped
28
+ callable object as references. This forwarding step shall ensure that
29
+ rvalue arguments are delivered as rvalue references and lvalue arguments
30
+ are delivered as lvalue references. A *simple call wrapper* is a
31
+ forwarding call wrapper that is `CopyConstructible` and `CopyAssignable`
32
+ and whose copy constructor, move constructor, and assignment operator do
33
+ not throw exceptions.
34
+
35
+ [*Note 1*:
36
+
37
+ In a typical implementation forwarding call wrappers have an overloaded
38
+ function call operator of the form
39
 
40
  ``` cpp
41
  template<class... UnBoundArgs>
42
  R operator()(UnBoundArgs&&... unbound_args) cv-qual;
43
  ```
44
 
45
+ — *end note*]
46
+