I have a structure with unnamed structure inside. I want to initialize whole structure and it's member structure in class initializer list.
struct Foo {
int z;
struct {
double upper;
double lower;
} x, y;
};
class Bar {
Bar();
Foo foo;
};
Can this be done?
Also can this structure be initialized "old fashion" way providing a constructor without uniform initialization syntax?
struct Foo {
Foo() : z(2), x(/*?*/), y(/*?*/) {}
Foo() : z(2), x.lower(2) {} // doesn't compile
int z;
struct {
double upper;
double lower;
} x, y;
};