![utouchpos default all utouchpos default all](https://i.ytimg.com/vi/hjY8vo4fJPU/hqdefault.jpg)
Every direct base of T has a trivial default constructor.T has no non-static members with default initializers.The constructor is not user-provided (i.e., is implicitly-defined or defaulted on its first declaration).performs no action) if all of the following is true: The default constructor for class T is trivial (i.e. If no user-defined constructors are present and the implicitly-declared default constructor is not trivial, the user may still inhibit the automatic generation of an implicitly-defined default constructor by the compiler with the keyword delete. T is a union and all of its variant members are const.T is a non-union class with a variant member M with a non-trivial default constructor, and no variant member of the anonymous union containing M has a default member initializer.T is a union with at least one variant member with non-trivial default constructor, and no variant member of T has a default member initializer.T has a direct or virtual base or a non-static data member which has a deleted destructor, or a destructor that is inaccessible from this constructor.T has a direct or virtual base which has a deleted default constructor, or it is ambiguous or inaccessible from this constructor.T has a member (without a default member initializer) (since C++11) which has a deleted default constructor, or its default constructor is ambiguous or inaccessible from this constructor.T has a non- const-default-constructible const member without a default member initializer (since C++11).T has a member of reference type without a default initializer (since C++11).The implicitly-declared or defaulted (since C++11) default constructor for class T is undefined (until C++11) defined as deleted (since C++11) if any of the following is true: Deleted implicitly-declared default constructor
![utouchpos default all utouchpos default all](https://i.ytimg.com/vi/mb7fvfqQrDg/mqdefault.jpg)
If some user-defined constructors are present, the user may still force the automatic generation of a default constructor by the compiler that would be implicitly-declared otherwise with the keyword default. (since C++11) Class types with an empty user-provided constructor may get treated differently than those with an implicitly-defined or defaulted default constructor during value initialization.
![utouchpos default all utouchpos default all](https://i.ytimg.com/vi/wiihz1ccn-8/maxresdefault.jpg)
If this satisfies the requirements of a constexpr constructor, the generated constructor is constexpr. That is, it calls the default constructors of the bases and of the non-static members of this class.
![utouchpos default all utouchpos default all](http://i2.ytimg.com/vi/iKI-2XUc1o8/default.jpg)
If the implicitly-declared default constructor is not defined as deleted, it is defined (that is, a function body is generated and compiled) by the compiler if odr-used or needed for constant evaluation (since C++11), and it has the same effect as a user-defined constructor with empty body and empty initializer list. The implicitly-declared (or defaulted on its first declaration) default constructor has an exception specification as described in dynamic exception specification (until C++17) exception specification (since C++17). If some user-declared constructors are present, the user may still force the automatic generation of a default constructor by the compiler that would be implicitly-declared otherwise with the keyword default. If no user-declared constructors of any kind are provided for a class type ( struct, class, or union), the compiler will always declare a default constructor as an inline public member of its class. Such constructor is treated as user-provided (see below and value initialization).ĭefault constructors are called during default initializations and value initializations. 5) Defaulted default constructor outside of class definition (the class must contain a declaration (1)).