問(wèn)題描述
我想使用 C++17 特性.
I want to use C++17 features.
如何在 Microsoft Visual Studio 中將編譯從 C++14 切換到 C++17?
How can I switch compiling from C++14 to C++17 in Microsoft Visual Studio?
或者它在 VS 的發(fā)布版本中不可用?
Or it's not avaiable in release versions of VS?
推薦答案
現(xiàn)在有一個(gè)下拉菜單(至少?gòu)?VS 2017.3.5 開(kāi)始),您可以在其中專(zhuān)門(mén)選擇 C++17.可用的選項(xiàng)是(在項(xiàng)目 > 屬性 > C/C++ > 語(yǔ)言 > C++ 語(yǔ)言標(biāo)準(zhǔn)下)
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 標(biāo)準(zhǔn).msvc 命令行選項(xiàng):
/std:c++14
- ISO C++17 標(biāo)準(zhǔn).msvc 命令行選項(xiàng):
/std:c++17
Visual Studio 2021:
Visual Studio 2021:
- ISO C++20 標(biāo)準(zhǔn).msvc 命令行選項(xiàng):
/std:c++20
任何 Visual Studio:
Any Visual Studio:
- 最新的標(biāo)準(zhǔn)草案.msvc 命令行選項(xiàng):
/std:c++latest
這篇關(guān)于如何在 Visual Studio 中啟用 C++17 編譯?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!