I'm using initializer lists for structs. But, it doesn't work with inheritance.
This code is good.
struct K {
int x, y;
};
K k {1, 2};
But, this produces an error.
struct L : public K {};
L l {1, 2};
Also, this does not work.
struct X {
int x;
};
struct Y : public X {
int y;
};
Y y {1, 2};
Is there a way to use initializer lists with inherited structs. I'm using them in templates and so it doesn't compile if it is an inherited class or not.