Skip to content

Commit 2ba729c

Browse files
author
3836425+corob-msft@users.noreply.github.com
committed
Add 3448,3482,3483,3540,3683 updates
1 parent ca5f5a8 commit 2ba729c

8 files changed

Lines changed: 81 additions & 54 deletions

‎docs/build/cmake-projects-in-visual-studio.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "CMake projects in Visual Studio"
33
description: "How to create and build C++ projects using CMake in Visual Studio."
4-
ms.date: 12/15/2021
4+
ms.date: 02/14/2022
55
helpviewer_keywords: ["CMake in Visual C++"]
66
ms.assetid: 444d50df-215e-4d31-933a-b41841f186f8
77
---
@@ -41,9 +41,9 @@ When you **open a folder** containing a *`CMakeLists.txt`* file, the following t
4141
> [!NOTE]
4242
> Starting in Visual Studio 2022 version 17.1 Preview 2, if your folder doesn't contain a root `CMakeLists.txt` you'll be prompted whether you'd like to enable CMake integration or not. For more information, see [CMake partial activation](#cmake-partial-activation).
4343
44-
Once CMake cache generation has succeeded, you can also view your projects organized logically by targets. Choose **Targets view** from the dropdown in the **Solution Explorer** toolbar:
44+
Once CMake cache generation has succeeded, you can also view your projects organized logically by targets. Choose the **Select View** button on the **Solution Explorer** toolbar. From the list in **Solution Explorer - Views**, select **CMake Targets View** and press **Enter** to open the targets view:
4545

46-
![CMake targets view button.](media/cmake-targets-view.png)
46+
:::image type="content" source="media/cmake-targets-view-dark.png" alt-text="Screenshot of the Solution Explorer window with the Select View toolbar button highlighted.":::
4747

4848
Choose the **Show All Files** button at the top of **Solution Explorer** to see all the CMake-generated output in the *`out/build/<config>`* folders.
4949

@@ -90,7 +90,7 @@ You can also disable all CMake cache notifications (gold bars) by deselecting **
9090

9191
If you need more information about the state of the CMake cache to diagnose a problem, open the **Project** main menu or the *`CMakeLists.txt`* context menu in **Solution Explorer** to run one of these commands:
9292

93-
- **View CMakeCache.txt** opens the *`CMakeCache.txt`* file from the build directory in the editor. Any edits you make here to *`CMakeCache.txt`* are wiped out if you clean the cache. To make changes that persist after you clean the cache, see [Customize CMake settings](customize-cmake-settings.md) or [Configure and Build with CMake Presets](cmake-presets-vs.md).
93+
- **View CMakeCache.txt** opens the *`CMakeCache.txt`* file from the build directory in the editor. Any edits you make here to *`CMakeCache.txt`* are wiped out if you clean the cache. To make changes that persist after you clean the cache, see [Customize CMake settings](customize-cmake-settings.md) or [Configure and build with CMake Presets](cmake-presets-vs.md).
9494

9595
- **Delete Cache and Reconfigure** deletes the build directory and reconfigures from a clean cache.
9696

@@ -149,7 +149,7 @@ Visual Studio allows you to debug a process running on a remote Linux system or
149149

150150
## <a name="cmake-partial-activation"></a> CMake partial activation
151151

152-
Starting in Visual Studio 2022 version 17.1 Preview 2, CMake functionality won't be enabled automatically if your root folder doesn't contain a `CMakeLists.txt` file. Instead, a dialog will prompt you on whether you'd like to enable CMake functionality for your project. If you decline, CMake cache generation won't start and CMake configurations (from `CMakeSettings.json` or `CMakePresets.json`) won't appear in the configuration dropdown. If you accept, you'll be taken to a workspace-level configuration file, `CMakeWorkspaceSettings.json` (stored in the `.vs` directory), to specify the folders you'd like to enable CMake for. (These folders contain your root `CMakeLists.txt` files).
152+
In Visual Studio 2022 version 17.1 and later, CMake functionality won't be enabled automatically if your root folder doesn't contain a `CMakeLists.txt` file. Instead, a dialog will prompt you on whether you'd like to enable CMake functionality for your project. If you decline, CMake cache generation won't start and CMake configurations (from `CMakeSettings.json` or `CMakePresets.json`) won't appear in the configuration dropdown. If you accept, you'll be taken to a workspace-level configuration file, `CMakeWorkspaceSettings.json` (stored in the `.vs` directory), to specify the folders you'd like to enable CMake for. (These folders contain your root `CMakeLists.txt` files).
153153

154154
The accepted properties are:
155155

@@ -197,7 +197,7 @@ As soon as you save the file, the configuration step automatically runs again an
197197

198198
### Language services for CMake
199199

200-
Language services for CMake are available in Visual Studio 2019 version 16.5 or later. Code navigation features like Go To Definition, Peek Definition, and Find All References are supported for CMake variables, functions, and targets in CMake script files. For more information, see [Code Navigation for CMake Scripts](https://devblogs.microsoft.com/cppblog/code-navigation-for-cmake-scripts/).
200+
Language services for CMake are available in Visual Studio 2019 version 16.5 or later. It supports code navigation features like Go To Definition, Peek Definition, and Find All References for CMake variables, functions, and targets in CMake script files. For more information, see [Code Navigation for CMake Scripts](https://devblogs.microsoft.com/cppblog/code-navigation-for-cmake-scripts/).
201201

202202
![Find All References on a CMake variable, target, or function.](media/cmake-find-all-refs.png)
203203

9.67 KB
Loading

‎docs/code-quality/c26812.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: "Learn more about: C26812"
33
title: c26812
44
keywords: c26812
5-
ms.date: 07/15/2019
5+
ms.date: 02/14/2022
66
ms.topic: reference
77
f1_keywords: ["C26812"]
88
helpviewer_keywords: ["C26812"]
@@ -12,32 +12,32 @@ dev_langs: ["C++"]
1212

1313
> Warning C26812: Prefer 'enum class' over 'enum' (Enum.3)
1414
15-
The enum type *type-name* is unscoped. Prefer 'enum class' over 'enum' (Enum.3)
15+
The `enum` type *type-name* is unscoped. Prefer `enum class` over `enum` (Enum.3)
1616

1717
## Example
1818

19-
The following example is from the C++ Core Guidelines
19+
The following example is from the C++ Core Guidelines:
2020

2121
```cpp
2222
void Print_color(int color);
2323

24-
enum Web_color { red = 0xFF0000, green = 0x00FF00, blue = 0x0000FF }; // C26812 reported here
25-
enum Product_info { Red = 0, Purple = 1, Blue = 2 }; // C26812 reported here
24+
enum Web_color { red = 0xFF0000, green = 0x00FF00, blue = 0x0000FF };
25+
enum Product_info { Red = 0, Purple = 1, Blue = 2 };
2626

2727
Web_color webby = Web_color::blue;
2828

2929
// Clearly at least one of these calls is buggy.
30-
Print_color(webby);
31-
Print_color(Product_info::Blue);
30+
Print_color(webby); // C26812
31+
Print_color(Product_info::Blue); // C26812
3232
```
3333
3434
These warnings are corrected by declaring the enum as enum class:
3535
3636
```cpp
3737
void Print_color(int color);
3838
39-
enum class Web_color { red = 0xFF0000, green = 0x00FF00, blue = 0x0000FF }; // no C26812
40-
enum class Product_info { red = 0, purple = 1, blue = 2 }; // no C26812
39+
enum class Web_color { red = 0xFF0000, green = 0x00FF00, blue = 0x0000FF };
40+
enum class Product_info { Red = 0, Purple = 1, Blue = 2 };
4141
4242
Web_color webby = Web_color::blue;
4343
Print_color(webby); // Error: cannot convert Web_color to int.
@@ -46,4 +46,4 @@ Print_color(Product_info::Red); // Error: cannot convert Product_info to int.
4646

4747
## See also
4848

49-
[Enum.3 Prefer enum class over enum](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#enum3-prefer-class-enums-over-plain-enums )
49+
[Enum.3 Prefer enum class over enum](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#enum3-prefer-class-enums-over-plain-enums)

‎docs/cpp/import-export-module.md‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: "module, import, export"
3-
ms.date: "12/12/2019"
3+
ms.date: 02/14/2022
44
f1_keywords: ["module_cpp", "import_cpp", "export_cpp"]
55
helpviewer_keywords: ["modules [C++]", "modules [C++], import", "modules [C++], export"]
66
description: Use import and export declarations to access and to publish types and functions defined in the specified module.
77
---
88
# `module`, `import`, `export`
99

10-
The **`module`**, **`import`**, and **`export`** declarations are available in C++20 and require the [/experimental:module](../build/reference/experimental-module.md) compiler switch along with [/std:c++20](../build/reference/std-specify-language-standard-version.md) or later (such as **`/std:c++latest`**). For more information, see [Overview of modules in C++](modules-cpp.md).
10+
The **`module`**, **`import`**, and **`export`** declarations are available in C++20 and require the [`/experimental:module`](../build/reference/experimental-module.md) compiler switch along with [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later (such as **`/std:c++latest`**). For more information, see [Overview of modules in C++](modules-cpp.md).
1111

1212
## `module`
1313

@@ -40,7 +40,7 @@ namespace ModuleA_NS
4040
}
4141
```
4242

43-
Non-exported names are not visible to code that imports the module:
43+
Non-exported names aren't visible to code that imports the module:
4444

4545
```cpp
4646
//MyProgram.cpp
@@ -56,7 +56,7 @@ int main() {
5656

5757
The **`export`** keyword may not appear in a module implementation file. When **`export`** is applied to a namespace name, all names in the namespace are exported.
5858

59-
## import
59+
## `import`
6060

6161
Use an **`import`** declaration to make a module's names visible in your program. The `import` declaration must appear after the `module` declaration and after any `#include` directives, but before any declarations in the file.
6262

@@ -76,10 +76,9 @@ class Baz
7676
7777
## Remarks
7878
79-
Both **import** and **module** are treated as keywords only when they appear at the start of a logical line:
79+
Both **`import`** and **`module`** are treated as keywords only when they appear at the start of a logical line:
8080
8181
```cpp
82-
8382
// OK:
8483
module ;
8584
module module-name
@@ -100,7 +99,7 @@ int i; module ;
10099

101100
**Microsoft Specific**
102101

103-
In Microsoft C++, the tokens **`import`** and **`module`** are always identifiers and never keywords when they are used as arguments to a macro.
102+
In Microsoft C++, the tokens **`import`** and **`module`** are always identifiers and never keywords when they're used as arguments to a macro.
104103

105104
### Example
106105

‎docs/cpp/modules-cpp.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Overview of modules in C++"
3-
ms.date: 02/03/2022
3+
ms.date: 02/14/2022
44
helpviewer_keywords: ["modules [C++]", "modules [C++], overview"]
55
description: Modules in C++20 provide a modern alternative to header files.
66
---
@@ -93,13 +93,13 @@ When it does argument-dependent lookup for overload resolutions in the importing
9393
A module can be componentized into *partitions*, each consisting of an interface file and zero or more implementation files. A module partition is similar to a module, except it shares ownership of all declarations in the entire module. All names exported by partition interface files are imported and re-exported by the primary interface file. A partition's name must begin with the module name followed by a colon. Declarations in any of the partitions are visible within the entire module. No special precautions are needed to avoid one-definition-rule (ODR) errors. You can declare a name (function, class, and so on) in one partition and define it in another. A partition implementation file begins like this:
9494

9595
```cpp
96-
module Example:part1
96+
module Example:part1;
9797
```
9898

9999
The partition interface file begins like this:
100100

101101
```cpp
102-
export module Example:part1
102+
export module Example:part1;
103103
```
104104

105105
To access declarations in another partition, a partition must import it, but it can only use the partition name, not the module name:
@@ -112,8 +112,8 @@ import :part1;
112112
The primary interface unit must import and re-export all of the module's interface partition files like this:
113113

114114
```cpp
115-
export import :part1
116-
export import :part2
115+
export import :part1;
116+
export import :part2;
117117
...
118118
```
119119

0 commit comments

Comments
 (0)