C++ – How to enable C++17 compiling in Visual Studio

c++c++17compilationvisual-studio

I want to use C++17 features.

How can I switch compiling from C++14 to C++17 in Microsoft Visual Studio?

Or it's not avaiable in release versions of VS?

Best Solution

There's now a drop down (at least since VS 2017.3.5) where you can specifically select C++17. The available options are (under project > Properties > C/C++ > Language > C++ Language Standard)

  • ISO C++14 Standard. msvc command line option: /std:c++14
  • ISO C++17 Standard. msvc command line option: /std:c++17
  • The latest draft standard. msvc command line option: /std:c++latest

(I bet, once C++20 is out and more fully supported by Visual Studio it will be /std:c++20)