Clang will not allow this type of initialisation

closed account (EwCjE3v7)
I get this error: http://postimg.org/image/eixljzmqx/

 
  vector<int> i{1,2,3,4,5,6,7,8,9,10};
closed account (EwCjE3v7)
Anyone?
Based on the error message, you're attempting to use clang++ in C++11 mode with the GNU gcc 4.2.1's library. That library is from 2007.
Last edited on
closed account (EwCjE3v7)
Thank you, removing that gave me an error:
expected ';' at the of declaration

vector<unsigned> vu{1,2,3};
..................................^
Last edited on
That was too little code to reproduce your error message.
Here's a complete program that executes that line, in clang++:

http://coliru.stacked-crooked.com/a/bb702a4fc78ab8b4
Topic archived. No new replies allowed.