Consider the following:
struct C {
C() { }
};
struct X {
C member;
X() { member = C(); }
};
The constructor X()is the same as if you said:
X() : member() { member = C(); }
First, the constructor Cis called to create the data item member. Then the body is executed X, the second, temporary object Cis created and assigned member, then the temporary is destroyed.
Note that this applies only to types that are initialized automatically. If it memberhad the type intor type of the POD class (as an example), it would be uninitialized when the constructor body is introduced X.
, ; . .