tmp/tmpqm1ybk9y/{from.md → to.md}
RENAMED
|
@@ -1,29 +1,30 @@
|
|
| 1 |
#### Initialization by conversion function for direct reference binding <a id="over.match.ref">[[over.match.ref]]</a>
|
| 2 |
|
| 3 |
Under the conditions specified in [[dcl.init.ref]], a reference can be
|
| 4 |
-
bound directly to
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
as follows:
|
| 11 |
|
| 12 |
- The conversion functions of `S` and its base classes are considered.
|
| 13 |
Those non-explicit conversion functions that are not hidden within `S`
|
| 14 |
and yield type “lvalue reference to *cv2* `T2`” (when initializing an
|
| 15 |
lvalue reference or an rvalue reference to function) or “*cv2* `T2`”
|
| 16 |
or “rvalue reference to *cv2* `T2`” (when initializing an rvalue
|
| 17 |
reference or an lvalue reference to function), where “*cv1* `T`” is
|
| 18 |
-
reference-compatible
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
|
| 26 |
The argument list has one argument, which is the initializer expression.
|
| 27 |
|
| 28 |
[*Note 1*: This argument will be compared against the implicit object
|
| 29 |
parameter of the conversion functions. — *end note*]
|
|
|
|
| 1 |
#### Initialization by conversion function for direct reference binding <a id="over.match.ref">[[over.match.ref]]</a>
|
| 2 |
|
| 3 |
Under the conditions specified in [[dcl.init.ref]], a reference can be
|
| 4 |
+
bound directly to the result of applying a conversion function to an
|
| 5 |
+
initializer expression. Overload resolution is used to select the
|
| 6 |
+
conversion function to be invoked. Assuming that “reference to *cv1*
|
| 7 |
+
`T`” is the type of the reference being initialized, and “cv `S`” is the
|
| 8 |
+
type of the initializer expression, with `S` a class type, the candidate
|
| 9 |
+
functions are selected as follows:
|
|
|
|
| 10 |
|
| 11 |
- The conversion functions of `S` and its base classes are considered.
|
| 12 |
Those non-explicit conversion functions that are not hidden within `S`
|
| 13 |
and yield type “lvalue reference to *cv2* `T2`” (when initializing an
|
| 14 |
lvalue reference or an rvalue reference to function) or “*cv2* `T2`”
|
| 15 |
or “rvalue reference to *cv2* `T2`” (when initializing an rvalue
|
| 16 |
reference or an lvalue reference to function), where “*cv1* `T`” is
|
| 17 |
+
reference-compatible [[dcl.init.ref]] with “*cv2* `T2`”, are candidate
|
| 18 |
+
functions. For direct-initialization, those explicit conversion
|
| 19 |
+
functions that are not hidden within `S` and yield type “lvalue
|
| 20 |
+
reference to *cv2* `T2`” (when initializing an lvalue reference or an
|
| 21 |
+
rvalue reference to function) or “rvalue reference to *cv2* `T2`”
|
| 22 |
+
(when initializing an rvalue reference or an lvalue reference to
|
| 23 |
+
function), where `T2` is the same type as `T` or can be converted to
|
| 24 |
+
type `T` with a qualification conversion [[conv.qual]], are also
|
| 25 |
+
candidate functions.
|
| 26 |
|
| 27 |
The argument list has one argument, which is the initializer expression.
|
| 28 |
|
| 29 |
[*Note 1*: This argument will be compared against the implicit object
|
| 30 |
parameter of the conversion functions. — *end note*]
|