cpp/language/direct initialization

Initializes an object from explicit set of constructor arguments.

Explanation
Direct initialization is performed in the following situations: @1@ Initialization with a nonempty parenthesized list of expressions. @2@ Initialization of an object of non-class type with a single brace-enclosed initializer. @3@ Initialization of by  or with a parenthesized expression list. @4@ Initialization of by a  expression. @5@ Initialization of an object with dynamic storage duration by a new-expression with a non-empty initializer. @6@ Initialization of a base or a non-static member by constructor. @7@ Initialization of closure object members from the variables caught by copy in a lambda-expression.

The effects of direct initialization are:


 * If is an array type,


 * If is a class type,


 * the constructors of are examined and the best match is selected by overload resolution. The constructor is then called to initialize the object.


 * Otherwise, if is a non-class type but the source type is a class type, the conversion functions of the source type and its base classes, if any, are examined and the best match is selected by overload resolution. The selected user-defined conversion is then used to convert the initializer expression into the object being initialized.
 * Otherwise, if is  and the source type is std, the value of the initialized object is.
 * Otherwise, are used, if necessary, to convert the value of  to the cv-unqualified version of, and the initial value of the object being initialized is the (possibly converted) value.