tmp/tmpa2xb6eci/{from.md → to.md}
RENAMED
|
@@ -2,11 +2,11 @@
|
|
| 2 |
|
| 3 |
When a parameter of reference type binds directly [[dcl.init.ref]] to an
|
| 4 |
argument expression, the implicit conversion sequence is the identity
|
| 5 |
conversion, unless the argument expression has a type that is a derived
|
| 6 |
class of the parameter type, in which case the implicit conversion
|
| 7 |
-
sequence is a derived-to-base
|
| 8 |
|
| 9 |
[*Example 4*:
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
struct A {};
|
|
@@ -18,12 +18,12 @@ int i = f(b); // calls f(B&), an exact match, rather than f(A&), a convers
|
|
| 18 |
|
| 19 |
— *end example*]
|
| 20 |
|
| 21 |
If the parameter binds directly to the result of applying a conversion
|
| 22 |
function to the argument expression, the implicit conversion sequence is
|
| 23 |
-
a user-defined conversion sequence [[over.ics.user]]
|
| 24 |
-
standard conversion sequence either an identity conversion or, if the
|
| 25 |
conversion function returns an entity of a type that is a derived class
|
| 26 |
of the parameter type, a derived-to-base conversion.
|
| 27 |
|
| 28 |
When a parameter of reference type is not bound directly to an argument
|
| 29 |
expression, the conversion sequence is the one required to convert the
|
|
@@ -37,11 +37,11 @@ Except for an implicit object parameter, for which see
|
|
| 37 |
[[over.match.funcs]], an implicit conversion sequence cannot be formed
|
| 38 |
if it requires binding an lvalue reference other than a reference to a
|
| 39 |
non-volatile `const` type to an rvalue or binding an rvalue reference to
|
| 40 |
an lvalue other than a function lvalue.
|
| 41 |
|
| 42 |
-
[*Note
|
| 43 |
a viable function if it has a non-`const` lvalue reference parameter
|
| 44 |
(other than the implicit object parameter) and the corresponding
|
| 45 |
argument would require a temporary to be created to initialize the
|
| 46 |
lvalue reference (see [[dcl.init.ref]]). — *end note*]
|
| 47 |
|
|
|
|
| 2 |
|
| 3 |
When a parameter of reference type binds directly [[dcl.init.ref]] to an
|
| 4 |
argument expression, the implicit conversion sequence is the identity
|
| 5 |
conversion, unless the argument expression has a type that is a derived
|
| 6 |
class of the parameter type, in which case the implicit conversion
|
| 7 |
+
sequence is a derived-to-base conversion [[over.best.ics]].
|
| 8 |
|
| 9 |
[*Example 4*:
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
struct A {};
|
|
|
|
| 18 |
|
| 19 |
— *end example*]
|
| 20 |
|
| 21 |
If the parameter binds directly to the result of applying a conversion
|
| 22 |
function to the argument expression, the implicit conversion sequence is
|
| 23 |
+
a user-defined conversion sequence [[over.ics.user]] whose second
|
| 24 |
+
standard conversion sequence is either an identity conversion or, if the
|
| 25 |
conversion function returns an entity of a type that is a derived class
|
| 26 |
of the parameter type, a derived-to-base conversion.
|
| 27 |
|
| 28 |
When a parameter of reference type is not bound directly to an argument
|
| 29 |
expression, the conversion sequence is the one required to convert the
|
|
|
|
| 37 |
[[over.match.funcs]], an implicit conversion sequence cannot be formed
|
| 38 |
if it requires binding an lvalue reference other than a reference to a
|
| 39 |
non-volatile `const` type to an rvalue or binding an rvalue reference to
|
| 40 |
an lvalue other than a function lvalue.
|
| 41 |
|
| 42 |
+
[*Note 9*: This means, for example, that a candidate function cannot be
|
| 43 |
a viable function if it has a non-`const` lvalue reference parameter
|
| 44 |
(other than the implicit object parameter) and the corresponding
|
| 45 |
argument would require a temporary to be created to initialize the
|
| 46 |
lvalue reference (see [[dcl.init.ref]]). — *end note*]
|
| 47 |
|