C++11 Features in Visual C++ 11
UPDATE – March 2, 2012: the range-based for-loop and override/final v1.0 have been implemented in VC11 Beta.
There’s a new C++ Standard and a new version of Visual C++, and it’s time to reveal what features from the former we’re implementing in the latter!
Terminology notes: During its development, the new C++ Standard was (optimistically) referred to as C++0x. It’s finally being published in 2011, and it’s now referred to as C++11. (Even International Standards slip their release dates.) The Final Draft International Standard is no longer publicly available. It was immediately preceded by Working Paper N3242, which is fairly close in content. (Most of the people who care about the differences are compiler/Standard Library devs who already have access to the FDIS.) Eventually, I expect that the C++11 Standard will be available from ANSI, like C++03 is.
As for Visual C++, it has three different version numbers, for maximum fun. There’s the branded version (printed on the box), the internal version (displayed in Help About), and the compiler version (displayed by cl.exe and the _MSC_VER macro – this one is different because our C++ compiler predates the “Visual” in Visual C++). For example:
VS 2005 == VC8 == _MSC_VER 1400
VS 2008 == VC9 == _MSC_VER 1500
VS 2010 == VC10 == _MSC_VER 1600
The final branding for the new version hasn’t been announced yet; for now, I’m supposed to say “Visual C++ in Visual Studio 11 Developer Preview”. Internally, it’s just VC11, and its _MSC_VER macro is 1700. (That macro is of interest to people who want to target different major versions of VC and emit different code for them.) I say VC10 and VC11 because they’re nice and simple – the 11 in VC11 does not refer to a year. (VS 2010 == VC10 was a confusing coincidence.)
If you read C++0x Core Language Features In VC10: The Table last year, the following table will look familiar to you. This time, I started with GCC’s table again, but I reorganized it more extensively for increased accuracy and clarity (as many features went through significant revisions):
|C++11 Core Language Features||VC10||VC11|
|Rvalue references v0.1, v1.0, v2.0, v2.1, v3.0||v2.0||v2.1*|
|Non-static data member initializers||No||No|
|Variadic templates v0.9, v1.0||No||No|
|auto v0.9, v1.0||v1.0||v1.0|
|Trailing return types||Yes||Yes|
|Lambdas v0.9, v1.0, v1.1||v1.0||v1.1|
|decltype v1.0, v1.1||v1.0||v1.1**|
|Right angle brackets||Yes||Yes|
|Default template arguments for function templates||No||No|
|Strongly typed enums||Partial||Yes|
|Forward declared enums||No||Yes|