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?
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)
/std:c++14
/std:c++17
/std:c++latest
(I bet, once C++20 is out and more fully supported by Visual Studio it will be /std:c++20
)
The syntax
-std:c++14
,-std:c++17
and-std:c++latest
also works, e.g. when you prefer to manually enter compiler options (tested with VS2017).Is that not clear from the answer already, or do you specifically mean
-
instead of the/std:
switches I list?I see the benefit when coming from
gcc
orclang
. Then the-
is less intrusive (however the syntax still differs slightly (:
instead of=
)).@AndreiKrasutski. There is no ISO C++20 yet but some support in /std:c++latest. The C++20 standard is expected next year. I Edited in a comment in my answer.
What C++ standard is used if there is nothing selected in Visual Studio 2017 > Project Properties > C / C++ > Language > C++ Standard dropdown? I have 14, 17 and latest in the dropdown, but none is selected, so how do I find what c++ standard is used in a project in that case?