Defining
struct A {
int a,b;
};
struct B {
A a;
int b;
};
the following initializations are obvious:
B b1 = { { 1 } };
B b2 = { { 1, 2 } };
B b3 = { { 1 }, 2 };
But I am surprised that VC ++ 2013 also allows these initializations without warning:
B b4 = { 1 };
B b5 = { 1, 2 };
B b6 = { 1, 2, 3 };
Are initializer lists for nested structures / classes standard C ++?
source
share