Files
2025-10-25 03:02:53 +03:00

60 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[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.4References"), 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*€ 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.4References"))
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.6Qualification 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*]