Hello Group,
I have a class A, which has three other members and each member is of a
different class
type.
If I don't create a destructor then the compiler will give me one and
whenever class A is
destroyed (whether on stack or on heap) the destructor of each
different object will be called.
However what will happen if the class A defines a destructor like
~A() {} // No code.
The question is that in this case will the destructor of individual
members be called or not,
since the destructor code is emply?
The whole code will look like:
class Object1 {
// Code destructor, constructor
}
class Object2 {
// Code destructor, constructor
}
class Object3 {
// Code destructor, constructor
}
class A {
Object1 o1;
Object2 o2;
Object3 o3;
~A() {} // The question is all about
}
Thanks
nagrik