There are four cases (1. member Class Object with default constructor; 2. base class with default constructor; 3. class with a virtual function; 4. A class with a virtual base class) causes "the compiler must synthesize a default constructor for a class without a declared constructor ". C ++ stardand calls those compositions implicit nontrivial Default constructors. The constructor can only meet the requirements of the compiler (rather Program . The task can be completed by calling the default constructor of the member object or base class, or initializing the virtual function or virtual base class mechanism of each object. As there are no such four cases and no constructor class is declared, we say they have implicit trivial Default constructors which will not actually be merged.
In the merged default constructor, only base class subobjects and member class objects will be initialized. All other nonstatic data member, such as integers, integer pointers, and integer arrays, are not initialized. These initialization operations may be required for the program, but this is not necessary for the compiler. If the program needs a default constructor that "sets a pointer to 0", the provider should be a programmer.
C ++ beginners generally have two common misunderstandings:
1. If no default constructor is defined for any class, a constructor is merged.
2. The default constructor synthesized by the compiler will explicitly set the default value for each data member in the class"