4

I got the community version of Visual Studio 2013 and I thought that c++11 was supposed to be enabled by default.

However, the macro __cplusplus has a value of 199711L (c++98) rather than 201103L (c++11). Furthermore, if I try to run c++11 specific code (likeconstexpr int a = 5;) it gives an error in the compiler. How do I enable c++11?

7

That the value of __cplusplus is still 199711L is a bug, which has been reported to Microsoft.

That shouldn't stop you from writing and compiling C++11 code. It should just work (nothing special to configure).

Beware that Visual Studio 2013's C++11 implementation is not complete. Among the unsupported features is constexpr, which explains why you're getting a compile error ;-)

  • 2
    As of June 20, 2016, the bug reported to Microsoft has been closed and deferred. __cplusplus is still 199711L at this time. Using Visual Studio 2015 Update 2. – tom_mai78101 Jun 20 '16 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.