[Solved] Is there a way to specify C++ compatibility level for Microsoft C++ compiler?


As of Visual C++ 2015 Update 3, it is now possible to specify a language version for language behavior (apparently it doesn’t affect just conformance checking):

https://blogs.msdn.microsoft.com/vcblog/2016/06/07/standards-version-switches-in-the-compiler/

Unfortunately the only options are “C++14” (not exact, it includes post-C++14 features which had previously shipped) and “C++ Latest” (C++14 plus partial implementation of C++17 and proposals, but not “experimental” features). There still are no options for enabling/disabling earlier versions of the language (C++98 / C++03 / C++11 as mentioned in the question)

The corresponding command line switches are:

  • /std:c++14
  • /std:c++latest

1

solved Is there a way to specify C++ compatibility level for Microsoft C++ compiler?