In place member initialization and aggregate initialization
问题 I have this simple struct and a function taking it: struct S { int a; }; void foo(S){} foo({5}); This works fine. But if I change int a; to int a{0}; VisualStudio (2013 and 2015) complains: error C2664: 'void foo(S)': cannot convert argument 1 from 'initializer list' to 'S' I can't find corresponding rule for this in the documentation. But both gcc and clang accept this without problem. 回答1: struct S { int a; }; is an aggregate whereas struct S { int a {0}; // or int a = 0; }; is not an