Skip to content

Commit 92fc56d

Browse files
committed
review edits
1 parent b78a346 commit 92fc56d

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

docs/build/reference/experimental-module.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
---
22
title: "/experimental:module (Enable module support)"
33
description: "Use the /experimental:module compiler option to enable experimental compiler support for named modules."
4-
ms.date: 01/27/2022
4+
ms.date: 02/12/2025
55
f1_keywords: ["module", "/experimental:module"]
66
helpviewer_keywords: ["module", "/experimental:module", "Enable module support"]
77
---
88
# `/experimental:module` (Enable experimental module support)
99

10-
Enables experimental compiler support for C++ Standard modules. This option is obsolete for C++20 standard modules in Visual Studio version 16.11 and later. This switch is only used (along with [`/std:c++latest`](std-specify-language-standard-version.md)) if you are still using the older experimental Standard library modules. We recommend that you use the new Standard Library modules provided by Microsoft without using this switch.
10+
Enables experimental compiler support for C++ Standard modules. This option is obsolete for C++20 standard modules in Visual Studio 2019 version 16.11 and later. This switch is only used (along with [`/std:c++latest`](std-specify-language-standard-version.md)) if you are still using the older experimental Standard library modules. We recommend that you use the new Standard Library modules provided by Microsoft without using this switch.
1111

1212
## Syntax
1313

1414
> **`/experimental:module`**\[**`-`**]
1515
1616
## Remarks
1717

18+
Although you can use this switch to use the older experimental named modules listed below, we recommend that you use the the new, standardized, way of consuming the C++ Standard Library as modules described in [Import the C++ standard library using modules](../../cpp/tutorial-import-stl-named-module.md).
19+
20+
Before you can use the experimental modules, ensure that **C++ Modules for v143 build tools (x64/x86 - experimental)** in selected the VS Installer. It's available in the **Individual components** tab of the installer. Search for **experimental** to see the option. For more information, see [Install C++ support in Visual Studio](../install/install-visual-cpp.md).
21+
1822
In versions of Visual Studio before Visual Studio 2019 version 16.11, you can enable experimental modules support using the **`/experimental:module`** compiler option along with the [`/std:c++latest`](std-specify-language-standard-version.md) option. In Visual Studio 2019 version 16.11, module support is enabled automatically by either **`/std:c++20`** or **`/std:c++latest`**. Use **`/experimental:module-`** to disable experimental module support.
1923

20-
This compiler switch is available starting in Visual Studio 2015 Update 1. Modules support is feature complete in Visual Studio 2019 version 16.10. You can use the modules feature import the Standard Library modules provided by Microsoft. The new, standardized, way of consuming the C++ Standard Library as modules is described in [Import the C++ standard library using modules](tutorial-import-stl-named-module.md).
24+
This compiler switch is available starting in Visual Studio 2015 Update 1. Modules support is feature complete in Visual Studio 2019 version 16.10.
2125

2226
For more information about how to use and create modules, see [Overview of modules in C++](../../cpp/modules-cpp.md).
2327

@@ -36,7 +40,7 @@ import std.core;
3640
import std.regex;
3741
```
3842

39-
To consume the experimental Microsoft Standard Library modules, compile your program with the [`/EHsc`](../build/reference/eh-exception-handling-model.md) and [`/MD`](../build/reference/md-mt-ld-use-run-time-library.md) options.
43+
To consume the experimental Microsoft Standard Library modules, compile your program with the [`/EHsc`](eh-exception-handling-model.md) and [`/MD`](md-mt-ld-use-run-time-library.md) options.
4044

4145
### To set this compiler option in the Visual Studio development environment
4246

docs/cpp/tutorial-named-modules-cpp.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Named modules tutorial in C++"
3-
ms.date: 08/08/2022
3+
ms.date: 02/12/2025
44
ms.topic: "tutorial"
55
author: "tylermsft"
66
ms.author: "twhitney"
@@ -237,7 +237,7 @@ int main()
237237
}
238238
```
239239

240-
The statement `import BasicPlane.Figures;` makes all the exported functions and types from the `BasicPlane.Figures` module visible to this file. It can come before or after any `#include` directives.
240+
The statement `import BasicPlane.Figures;` makes all the exported functions and types from the `BasicPlane.Figures` module visible to this file. It should come after any `#include` directives.
241241

242242
The app then uses the types and functions from the module to output the area and width of the defined rectangle:
243243

@@ -265,7 +265,7 @@ module; // optional. Defines the beginning of the global module fragment
265265

266266
// #include directives go here but only apply to this file and
267267
// aren't shared with other module implementation files.
268-
// Macro definitions aren't visible outside this file, or to importers.
268+
// Macro definitions aren't visible outside this file or to importers.
269269
// import statements aren't allowed here. They go in the module preamble, below.
270270

271271
export module [module-name]; // Required. Marks the beginning of the module preamble
@@ -305,7 +305,8 @@ Module implementation units are useful for breaking up a large module into small
305305
Module implementation unit files have a *`.cpp`* extension. The basic outline of a module implementation unit file is:
306306

307307
```cpp
308-
// optional #include or import statements. These only apply to this file
308+
// optional #include statements. These only apply to this file
309+
// optional import statements. These only apply to this file
309310
// imports in the associated module's interface are automatically available to this file
310311

311312
module [module-name]; // required. Identifies which named module this implementation unit belongs to

0 commit comments

Comments
 (0)