From Jason Turner

[over.over]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpubvanc6q/{from.md → to.md} +26 -32
tmp/tmpubvanc6q/{from.md → to.md} RENAMED
@@ -1,25 +1,26 @@
1
- ## Address of overloaded function <a id="over.over">[[over.over]]</a>
2
 
3
- A use of a function name without arguments is resolved to a function, a
4
- pointer to function, or a pointer to member function for a specific
5
- function that is chosen from a set of selected functions determined
6
- based on the target type required in the context (if any), as described
7
- below. The target can be
 
8
 
9
- - an object or reference being initialized ([[dcl.init]],
10
- [[dcl.init.ref]], [[dcl.init.list]]),
11
  - the left side of an assignment [[expr.ass]],
12
  - a parameter of a function [[expr.call]],
13
  - a parameter of a user-defined operator [[over.oper]],
14
  - the return value of a function, operator function, or conversion
15
  [[stmt.return]],
16
- - an explicit type conversion ([[expr.type.conv]],
17
- [[expr.static.cast]], [[expr.cast]]), or
18
  - a non-type *template-parameter* [[temp.arg.nontype]].
19
 
20
- The function name can be preceded by the `&` operator.
21
 
22
  [*Note 1*: Any redundant set of parentheses surrounding the function
23
  name is ignored [[expr.prim.paren]]. — *end note*]
24
 
25
  If there is no target, all non-template functions named are selected.
@@ -28,30 +29,23 @@ function type `FT` of the target type if `F` (after possibly applying
28
  the function pointer conversion [[conv.fctptr]]) is identical to `FT`.
29
 
30
  [*Note 2*: That is, the class of which the function is a member is
31
  ignored when matching a pointer-to-member-function type. — *end note*]
32
 
33
- For each function template designated by the name, template argument
34
- deduction is done [[temp.deduct.funcaddr]], and if the argument
35
- deduction succeeds, the resulting template argument list is used to
36
- generate a single function template specialization, which is added to
37
- the set of selected functions considered.
38
 
39
- [*Note 3*: As described in  [[temp.arg.explicit]], if deduction fails
40
- and the function template name is followed by an explicit template
41
- argument list, the *template-id* is then examined to see whether it
42
- identifies a single function template specialization. If it does, the
43
- *template-id* is considered to be an lvalue for that function template
44
- specialization. The target type is not used in that
45
- determination. — *end note*]
46
 
47
- Non-member functions and static member functions match targets of
48
- function pointer type or reference to function type. Non-static member
49
- functions match targets of pointer-to-member-function type. If a
50
- non-static member function is selected, the reference to the overloaded
51
- function name is required to have the form of a pointer to member as
52
- described in  [[expr.unary.op]].
53
 
54
  All functions with associated constraints that are not satisfied
55
  [[temp.constr.decl]] are eliminated from the set of selected functions.
56
  If more than one function in the set remains, all function template
57
  specializations in the set are eliminated if the set also contains a
@@ -99,13 +93,13 @@ int (X::*p5)(int) = &(X::f); // error: wrong syntax for
99
  int (*p6)(long) = &(X::f); // OK
100
  ```
101
 
102
  — *end example*]
103
 
104
- [*Note 4*: If `f()` and `g()` are both overloaded functions, the cross
105
- product of possibilities must be considered to resolve `f(&g)`, or the
106
- equivalent expression `f(g)`. — *end note*]
107
 
108
  [*Note 5*:
109
 
110
  Even if `B` is a public base of `D`, we have
111
 
 
1
+ ## Address of an overload set <a id="over.over">[[over.over]]</a>
2
 
3
+ An *id-expression* whose terminal name refers to an overload set S and
4
+ that appears without arguments is resolved to a function, a pointer to
5
+ function, or a pointer to member function for a specific function that
6
+ is chosen from a set of functions selected from S determined based on
7
+ the target type required in the context (if any), as described below.
8
+ The target can be
9
 
10
+ - an object or reference being initialized
11
+ [[dcl.init]], [[dcl.init.ref]], [[dcl.init.list]],
12
  - the left side of an assignment [[expr.ass]],
13
  - a parameter of a function [[expr.call]],
14
  - a parameter of a user-defined operator [[over.oper]],
15
  - the return value of a function, operator function, or conversion
16
  [[stmt.return]],
17
+ - an explicit type conversion
18
+ [[expr.type.conv]], [[expr.static.cast]], [[expr.cast]], or
19
  - a non-type *template-parameter* [[temp.arg.nontype]].
20
 
21
+ The *id-expression* can be preceded by the `&` operator.
22
 
23
  [*Note 1*: Any redundant set of parentheses surrounding the function
24
  name is ignored [[expr.prim.paren]]. — *end note*]
25
 
26
  If there is no target, all non-template functions named are selected.
 
29
  the function pointer conversion [[conv.fctptr]]) is identical to `FT`.
30
 
31
  [*Note 2*: That is, the class of which the function is a member is
32
  ignored when matching a pointer-to-member-function type. — *end note*]
33
 
34
+ The specialization, if any, generated by template argument deduction
35
+ [[temp.over]], [[temp.deduct.funcaddr]], [[temp.arg.explicit]] for each
36
+ function template named is added to the set of selected functions
37
+ considered.
 
38
 
39
+ Non-member functions, static member functions, and explicit object
40
+ member functions match targets of function pointer type or reference to
41
+ function type. Implicit object member functions match targets of
42
+ pointer-to-member-function type.
 
 
 
43
 
44
+ [*Note 3*: If an implicit object member function is chosen, the result
45
+ can be used only to form a pointer to member
46
+ [[expr.unary.op]]. *end note*]
 
 
 
47
 
48
  All functions with associated constraints that are not satisfied
49
  [[temp.constr.decl]] are eliminated from the set of selected functions.
50
  If more than one function in the set remains, all function template
51
  specializations in the set are eliminated if the set also contains a
 
93
  int (*p6)(long) = &(X::f); // OK
94
  ```
95
 
96
  — *end example*]
97
 
98
+ [*Note 4*: If `f` and `g` are both overload sets, the Cartesian product
99
+ of possibilities is considered to resolve `f(&g)`, or the equivalent
100
+ expression `f(g)`. — *end note*]
101
 
102
  [*Note 5*:
103
 
104
  Even if `B` is a public base of `D`, we have
105