tmp/tmp4adb1upf/{from.md → to.md}
RENAMED
|
@@ -2,29 +2,32 @@
|
|
| 2 |
|
| 3 |
Under the conditions specified in [[dcl.init]], as part of a
|
| 4 |
copy-initialization of an object of class type, a user-defined
|
| 5 |
conversion can be invoked to convert an initializer expression to the
|
| 6 |
type of the object being initialized. Overload resolution is used to
|
| 7 |
-
select the user-defined conversion to be invoked.
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
- The converting constructors ([[class.conv.ctor]]) of `T` are
|
| 12 |
candidate functions.
|
| 13 |
- When the type of the initializer expression is a class type “*cv*
|
| 14 |
`S`”, the non-explicit conversion functions of `S` and its base
|
| 15 |
classes are considered. When initializing a temporary to be bound to
|
| 16 |
the first parameter of a constructor that takes a reference to
|
| 17 |
possibly cv-qualified `T` as its first argument, called with a single
|
| 18 |
-
argument in the context of direct-initialization
|
| 19 |
-
functions are also considered. Those
|
| 20 |
-
and yield a type whose cv-unqualified
|
| 21 |
-
or is a derived class thereof are
|
| 22 |
-
functions that return “reference to
|
| 23 |
-
depending on the type of reference, of
|
| 24 |
-
considered to yield `X` for this process of
|
| 25 |
-
functions.
|
| 26 |
|
| 27 |
In both cases, the argument list has one argument, which is the
|
| 28 |
initializer expression. This argument will be compared against the first
|
| 29 |
parameter of the constructors and against the implicit object parameter
|
| 30 |
of the conversion functions.
|
|
|
|
| 2 |
|
| 3 |
Under the conditions specified in [[dcl.init]], as part of a
|
| 4 |
copy-initialization of an object of class type, a user-defined
|
| 5 |
conversion can be invoked to convert an initializer expression to the
|
| 6 |
type of the object being initialized. Overload resolution is used to
|
| 7 |
+
select the user-defined conversion to be invoked. The conversion
|
| 8 |
+
performed for indirect binding to a reference to a possibly cv-qualified
|
| 9 |
+
class type is determined in terms of a corresponding non-reference
|
| 10 |
+
copy-initialization. Assuming that “*cv1* `T`” is the type of the object
|
| 11 |
+
being initialized, with `T` a class type, the candidate functions are
|
| 12 |
+
selected as follows:
|
| 13 |
|
| 14 |
- The converting constructors ([[class.conv.ctor]]) of `T` are
|
| 15 |
candidate functions.
|
| 16 |
- When the type of the initializer expression is a class type “*cv*
|
| 17 |
`S`”, the non-explicit conversion functions of `S` and its base
|
| 18 |
classes are considered. When initializing a temporary to be bound to
|
| 19 |
the first parameter of a constructor that takes a reference to
|
| 20 |
possibly cv-qualified `T` as its first argument, called with a single
|
| 21 |
+
argument in the context of direct-initialization of an object of type
|
| 22 |
+
“*cv2* `T`”, explicit conversion functions are also considered. Those
|
| 23 |
+
that are not hidden within `S` and yield a type whose cv-unqualified
|
| 24 |
+
version is the same type as `T` or is a derived class thereof are
|
| 25 |
+
candidate functions. Conversion functions that return “reference to
|
| 26 |
+
`X`” return lvalues or xvalues, depending on the type of reference, of
|
| 27 |
+
type `X` and are therefore considered to yield `X` for this process of
|
| 28 |
+
selecting candidate functions.
|
| 29 |
|
| 30 |
In both cases, the argument list has one argument, which is the
|
| 31 |
initializer expression. This argument will be compared against the first
|
| 32 |
parameter of the constructors and against the implicit object parameter
|
| 33 |
of the conversion functions.
|