struct foo { int a, b, c; }; void i_only_take_three_braced_parameters(foo f){ // ...} int main(){ i_only_take_three_braced_parameters({1, 2, 3}); i_only_take_three_braced_parameters({1, 2, 3, 4});}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:11:53: error: could not convert ‘{1, 2, 3, 4}’ from ‘<brace-enclosed initializer list>’ to ‘foo’ i_only_take_three_braced_parameters({1, 2, 3, 4}); ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!