Skip to content

Commit 5204760

Browse files
TylerMSFTTylerMSFT
TylerMSFT
authored and
TylerMSFT
committed
clarify how macro value is set
1 parent 33b853d commit 5204760

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Diff for: docs/build/reference/std-specify-language-standard-version.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/std (Specify Language Standard Version)"
33
description: "The MSVC compiler option /std specifies the C or C++ language standard supported by the compiler."
4-
ms.date: 4/5/2023
4+
ms.date: 4/9/2023
55
f1_keywords: ["/std", "-std", "/std:c++14", "/std:c++17", "/std:c++20", "/std:c11", "/std:c17", "/std:clatest", "VC.Project.VCCLCompilerTool.CppLanguageStandard"]
66
---
77
# `/std` (Specify Language Standard Version)
@@ -29,13 +29,7 @@ The Microsoft C++ compiler in Visual Studio 2017 and later versions doesn't supp
2929
The **`/std`** option in effect during a C++ compilation can be detected by use of the [`_MSVC_LANG`](../../preprocessor/predefined-macros.md) preprocessor macro. For more information, see [Preprocessor Macros](../../preprocessor/predefined-macros.md).
3030

3131
> [!IMPORTANT]
32-
> Because some existing code depends on the value of the macro `__cplusplus` being 199711L, the MSVC compiler doesn't change the value of this macro unless you explicitly opt in by setting [`/Zc:__cplusplus`](zc-cplusplus.md). Here are the values for `__cplusplus` depending on the language version you are compiling with:
33-
>
34-
> | Language version | __cplusplus value |
35-
> |------------------|-------------------|
36-
> | `/std:c++14` | 201402 |
37-
> | `/std:c++17` | 201703 |
38-
> | `/std:c++20` | 202002 |
32+
> Because some existing code depends on the value of the macro `__cplusplus` being `199711L`, the MSVC compiler doesn't change the value of this macro unless you explicitly opt in by setting [`/Zc:__cplusplus`](zc-cplusplus.md). Specify `/Zc:__cplusplus` and the **`/std`** option to set `__cplusplus` to the appropriate value.
3933
4034
**`/std:c++14`**\
4135
The **`/std:c++14`** option enables C++14 standard-specific features implemented by the MSVC compiler. This option is the default for code compiled as C++. It's available starting in Visual Studio 2015 Update 3.

0 commit comments

Comments
 (0)