Files
cppdraft_translate/cppdraft/over/match/ctor.md
2025-10-25 03:02:53 +03:00

1.7 KiB

[over.match.ctor]

12 Overloading [over]

12.2 Overload resolution [over.match]

12.2.2 Candidate functions and argument lists [over.match.funcs]

12.2.2.4 Initialization by constructor [over.match.ctor]

1

#

When objects of class type are direct-initialized, copy-initialized from an expression of the same or a derived class type ([dcl.init]), or default-initialized, overload resolution selects the constructor.

For direct-initialization or default-initialization (including default-initialization in the context of copy-list-initialization), the candidate functions are all the constructors of the class of the object being initialized.

Otherwise, the candidate functions are all the non-explicit constructors ([class.conv.ctor]) of that class.

The argument list is theexpression-list or assignment-expression of the initializer.

For default-initialization in the context of copy-list-initialization, if an explicit constructor is chosen, the initialization is ill-formed.