Let's say I have a basic class A that aggregate B and C:
class A
{
B _b;
C _c;
}
in what order are _b and _c going to be deleted?
I've read somewhere that it's the reverse order of their allocation.
So I guess in this little example _c is deleted before _b, right?
Now if I have a A constructor that looks like that:
A::A():
_c(...),
_b(...)
{
}
In what order are _b and _c's constructors called?
If _b's constructor is indeed called before _c's one (regarding their order in A), then I find it really counter intuitive!
In this case what will be the order of destruction?
Thanks for your help ! :)
(On a side note I seem totally unable to type '}' into Stackoverflow's editor. Had to copy and paste from an external editor !?)