I had some code that I developed on Ubuntu and now I am trying to compile it on Windows 7 (MS VS 2010).
vector<float> tmp;
....
tmp = {3.0,4.5,9.4};
This gives me syntax error
error C2143: syntax error : missing ';' before '{'
Is this because Visual studio doesn’t support this feature ? or should I be enabling some switch in the properties. I have the “Platform Toolset” property set to “v100.”
Thank you.
The C++0x features are enabled by default on the Visual Studio 2010 C++ compiler. It takes no extra switches for example to use lambdas,
auto, etc … If you’re getting that error it’s because in all likelyhood it’s not supported.EDIT
Based on this MSDN article, initializer lists are not one of the 6 supported features in 2010