2.5 KiB
[over.match.copy]
12 Overloading [over]
12.2 Overload resolution [over.match]
12.2.2 Candidate functions and argument lists [over.match.funcs]
12.2.2.5 Copy-initialization of class by user-defined conversion [over.match.copy]
Under the conditions specified in [dcl.init], as part of a copy-initialization of an object of class type, a user-defined conversion can be invoked to convert an initializer expression to the type of the object being initialized.
Overload resolution is used to select the user-defined conversion to be invoked.
[Note 1:
The conversion performed for indirect binding to a reference to a possibly cv-qualified class type is determined in terms of a corresponding non-reference copy-initialization.
â end note]
Assuming that âcv1 Tâ is the type of the object being initialized, withT a class type, the candidate functions are selected as follows:
-
The non-explicit constructors ([class.conv.ctor]) ofT are candidate functions.
-
When the type of the initializer expression is a class type âcv Sâ, conversion functions are considered. The permissible types for non-explicit conversion functions areT and any class derived from T. When initializing a temporary object ([class.mem]) to be bound to the first parameter of a constructor where the parameter is of type âreference to cv2 Tâ and the constructor is called with a single argument in the context of direct-initialization of an object of type âcv3 Tâ, the permissible types for explicit conversion functions are the same; otherwise there are none.
In both cases, the argument list has one argument, which is the initializer expression.
[Note 2:
This argument will be compared against the first parameter of the constructors and against the object parameter of the conversion functions.
â end note]