Consider the following hierarchy of classes:
struct B {
int i;
};
struct D : B {
int j;
};
B
is aggregate class, but D
is not (because of base class existance).
Is there a way to initialize array of D
's like aggregate (i.e. without having user writen constructors)?
B b[] = {1, 2, 3}; // ok
D d[] = { ????? }; // is it possible?