60 lines
2.1 KiB
Markdown
60 lines
2.1 KiB
Markdown
[over.match.ref]
|
||
|
||
# 12 Overloading [[over]](./#over)
|
||
|
||
## 12.2 Overload resolution [[over.match]](over.match#ref)
|
||
|
||
### 12.2.2 Candidate functions and argument lists [[over.match.funcs]](over.match.funcs#over.match.ref)
|
||
|
||
#### 12.2.2.7 Initialization by conversion function for direct reference binding [over.match.ref]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L1143)
|
||
|
||
Under the conditions specified in [[dcl.init.ref]](dcl.init.ref "9.5.4 References"), a reference can be bound directly
|
||
to the result of applying a conversion
|
||
function to an initializer expression[.](#1.sentence-1)
|
||
|
||
Overload resolution is used to select the
|
||
conversion function to be invoked[.](#1.sentence-2)
|
||
|
||
Assuming that âreference to *cv1* Tâ is the
|
||
type of the reference being initialized,
|
||
the candidate functions are selected as follows:
|
||
|
||
- [(1.1)](#1.1)
|
||
|
||
Let R be a set of types including
|
||
* [(1.1.1)](#1.1.1)
|
||
|
||
âlvalue reference to *cv2* T2â
|
||
(when converting to an lvalue) and
|
||
|
||
* [(1.1.2)](#1.1.2)
|
||
|
||
â*cv2* T2â
|
||
and ârvalue reference to *cv2* T2â
|
||
(when converting to an rvalue or an lvalue of function type)
|
||
|
||
for any T2[.](#1.sentence-3)
|
||
The permissible types for non-explicit conversion functions are
|
||
the members of R where â*cv1* Tâ is reference-compatible ([[dcl.init.ref]](dcl.init.ref "9.5.4 References"))
|
||
with â*cv2* T2â[.](#1.1.sentence-2)
|
||
For direct-initialization, the permissible types for explicit
|
||
conversion functions are the members of R where T2 can be converted to type T with a (possibly trivial) qualification conversion ([[conv.qual]](conv.qual "7.3.6 Qualification conversions"));
|
||
otherwise there are none[.](#1.1.sentence-3)
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L1176)
|
||
|
||
The argument list has one argument, which is the initializer expression[.](#2.sentence-1)
|
||
|
||
[*Note [1](#note-1)*:
|
||
|
||
This argument will be compared against
|
||
the object parameter of the conversion functions[.](#2.sentence-2)
|
||
|
||
â *end note*]
|