@firstPerson the default Constructor & Destructor are not always trivial at the Compiler level, to users it might be...
Hi lotrsimp12345,
This usually irritates the programmer that why the compiler emits a default constructor.
Let me explain you a bit detail of how C++ standard dictate about default constructor and its semantics.
if your class contains primitive types, then your default constructor would be trivial i.e.
class Foo {
public:
int a;
}
if we consider the Foo class its default constructor would be trivial i.e. doesn't modify the state and probably member "a" contains the garbage (or some 0xCCCCCCCC etc). Basically in C++ its always the programmer's responsiblity to intialize the values. This is what standard tells us. Logically if we look with the eye of programmer it seems irritating for us to explicitly intialize the value, yes it is, but we have some other facilities (default argument values) in the language to acheive the same.
In above code Bar is the subobject which must be initialized before the intialization of Foo in this case compiler synthesized the constructor which in turns calls the default constructor for Bar. same goes for inheritance as well and obviously destructor would release the memory by calling the destructor of subobjects.
if C++ default constructor initializes the memory to "ZERO values" for primitive types then the name of default constructor should be "ZERO Constructor"

rather than default constructor.