Which version of C# am I using

Visual Studio 2008? You can forget C++11. Visual Studio 2010 has some C++11 but it's buggy. Visual Studio 2012 has better C++11 for some features, but others are missing. Visual Studio 2013 has new support for variadic templates and other features. But VS is behind other compilers such as gcc in C++11 support. You can download free express editions for all these versions.


It's not as simple as a version check.

Every compiler that supports some C++11 supports a different subset of C++11. No compiler advertises full compliance with C++11 yet, for obvious reasons.

The C++11 specification requires that a predefined macro, __cplusplus be defined which has the value 201103L. However, you cannot rely on this macro alone. Not in real code.

You instead have to rely on compiler-specific macros to tell when compiler and which version of that compiler you're using. Or you can use Boost.Config to help you detect whether specific features are supported.

Tags:

C#

Version