Skip to content

Commit 913ef4a

Browse files
Merge pull request #5302 from MicrosoftDocs/main638808534271180125sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 3cc426f + d9bfda5 commit 913ef4a

File tree

6 files changed

+30
-28
lines changed

6 files changed

+30
-28
lines changed

docs/build/reference/experimental-module.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Enables compiler support for Microsoft's experimental form of C++ Standard modul
1515
1616
## Remarks
1717

18-
This switch was for the time before 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) was available. Although you can use this switch to use the older experimental named modules, we recommend that you use 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).
18+
This switch applies to the time before the new, standardized, way of consuming the C++ Standard Library as modules was available. Although you can use this switch to use the older experimental named modules, we recommend that you use 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).
1919

20-
This compiler became available starting in Visual Studio 2015 Update 1. 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 and C++ support in Visual Studio](../vscpp-step-0-installation.md).
20+
This compiler switch is available starting in Visual Studio 2015 Update 1. In the VS Installer under the **Individual components** tab, ensure that **C++ Modules for v143 build tools (x64/x86 - experimental)** is selected. You can use the search box with **experimental** to find it. For more information, see [Install C and C++ support in Visual Studio](../vscpp-step-0-installation.md).
2121

2222
| Version | Status |
2323
|---|---|
@@ -54,6 +54,7 @@ For more information about how to use and create modules, see [Overview of modul
5454

5555
## See also
5656

57+
[Import the C++ standard library using modules](../../cpp/tutorial-import-stl-named-module.md)\
5758
[`/headerUnit` (Use header unit IFC)](headerunit.md)\
5859
[`/exportHeader` (Create header units)](module-exportheader.md)\
5960
[`/reference` (Use named module IFC)](module-reference.md)\

docs/build/reference/scandependencies.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ Consider the following sample code:
6060
#include <vector>
6161

6262
import other.module;
63-
import std.core;
64-
63+
import std;
6564
import "t.h";
66-
6765
import <iostream>;
6866

6967
int main() {}
@@ -83,14 +81,14 @@ The compiler produces a JSON file, *`output.json`*, with content similar to:
8381
{
8482
"primary-output": "app.obj",
8583
"outputs": [
86-
"C:\\Users\\username\\source\\repos\\app\\app"
84+
"output.json"
8785
],
8886
"requires": [
8987
{
9088
"logical-name": "other.module"
9189
},
9290
{
93-
"logical-name": "std.core"
91+
"logical-name": "std"
9492
},
9593
{
9694
"logical-name": "t.h",
@@ -134,6 +132,7 @@ To report module and header unit dependencies, you must also set the **Configura
134132

135133
## See also
136134

135+
[Import the C++ standard library using modules](../../cpp/tutorial-import-stl-named-module.md)\
137136
[MSVC compiler options](compiler-options.md)\
138137
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)\
139138
[`/sourceDependencies:directives`](sourcedependencies-directives.md)\

docs/build/reference/sourcedependencies-directives.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ Given the following sample code:
5959
#include <vector>
6060

6161
import m;
62-
import std.core;
63-
62+
import std;
6463
import <utility>;
65-
6664
import "t.h";
6765

6866
int main() {}
@@ -78,15 +76,16 @@ produces a JSON file *`output.json`* similar to:
7876
{
7977
"Version":"1.1",
8078
"Data":{
81-
"Source":"C:\\a\\b\\main.cpp",
79+
"Source":"C:\\test\\main.cpp",
8280
"ProvidedModule":"",
8381
"ImportedModules":[
8482
"m",
85-
"std.core"
83+
"std"
8684
],
8785
"ImportedHeaderUnits":[
8886
"C:\\...\\utility",
89-
"C:\\a\\b\\t.h"
87+
"C:\\...\\vector",
88+
"C:\\test\\t.h"
9089
]
9190
}
9291
}
@@ -104,6 +103,7 @@ You normally shouldn't set this option yourself in the Visual Studio development
104103

105104
## See also
106105

106+
[Import the C++ standard library using modules](../../cpp/tutorial-import-stl-named-module.md)\
107107
[`/translateInclude`](translateinclude.md)\
108108
[C++ header-units.json reference](header-unit-json-reference.md)\
109109
[MSVC compiler options](compiler-options.md)\

docs/c-runtime-library/floating-point-support.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ The Universal C Runtime library (UCRT) provides many integral and floating-point
1111

1212
For ISO C Standard 11 (C11) and later, the `<tgmath.h>` header, in addition to including `<math.h>` and `<complex.h>`, provides macros that invoke a corresponding math function based on the types of the parameters. See [Type-generic math](tgmath.md) for details.
1313

14-
Many of the floating point math library functions have different implementations for different CPU architectures. For example, the 32-bit x86 CRT may have a different implementation than the 64-bit x64 CRT. In addition, some of the functions may have multiple implementations for a given CPU architecture. The most efficient implementation is selected dynamically at run-time depending on the instruction sets supported by the CPU. For example, in the 32-bit x86 CRT, some functions have both an x87 implementation and an SSE2 implementation. When running on a CPU that supports SSE2, the faster SSE2 implementation is used. When running on a CPU that doesn't support SSE2, the slower x87 implementation is used. Because different implementations of the math library functions may use different CPU instructions and different algorithms to produce their results, the functions may produce different results across CPUs. In most cases, the results are within +/-1 ULP of the correctly rounded result, but the actual results may vary across CPUs.
14+
Many of the floating-point math library functions have different implementations for different CPU architectures. For example, the 32-bit x86 CRT may have a different implementation than the 64-bit x64 CRT. In addition, some of the functions may have multiple implementations for a given CPU architecture. The most efficient implementation is selected dynamically at run-time depending on the instruction sets supported by the CPU. For example, in the 32-bit x86 CRT, some functions have both an x87 implementation and an SSE2 implementation. When running on a CPU that supports SSE2, the faster SSE2 implementation is used. When running on a CPU that doesn't support SSE2, the slower x87 implementation is used. Because different implementations of the math library functions may use different CPU instructions and different algorithms to produce their results, the functions may produce different results across CPUs. In most cases, the results are within +/-1 ULP of the correctly rounded result, but the actual results may vary across CPUs.
15+
16+
Newer versions of the UCRT might improve the precision and accuracy of the floating-point math library functions. Since the UCRT is part of the Windows operating system, you might get different results for these functions on different operating system versions or between debug and release builds. Although it is not recommended, you can statically link to the UCRT to guarantee consistent results if you need these functions will produce identical results everywhere.
1517

1618
Previous 16-bit versions of Microsoft C/C++ and Microsoft Visual C++ supported the **`long double`** type as an 80-bit precision floating-point data type. In later versions of Visual C++, the **`long double`** data type is a 64-bit precision floating-point data type identical to the **`double`** type. The compiler treats **`long double`** and **`double`** as distinct types, but the **`long double`** functions are identical to their **`double`** counterparts. The CRT provides **`long double`** versions of the math functions for ISO C99 source code compatibility, but note that the binary representation may differ from other compilers.
1719

@@ -79,7 +81,7 @@ Previous 16-bit versions of Microsoft C/C++ and Microsoft Visual C++ supported t
7981
| [`imaxabs`](./reference/imaxabs.md) | Computes the absolute value of an integer type |
8082
| [`imaxdiv`](./reference/imaxdiv.md) | Computes the quotient and the remainder of two integer values |
8183
| [`isfinite`, `_finite`, `_finitef`](./reference/finite-finitef.md) | Determines whether a value is finite |
82-
| [`isgreater`, `isgreaterequal`, `isless`, `islessequal`, `islessgreater`, `isunordered`](./reference/floating-point-ordering.md) | Compare the order of two floating point values |
84+
| [`isgreater`, `isgreaterequal`, `isless`, `islessequal`, `islessgreater`, `isunordered`](./reference/floating-point-ordering.md) | Compare the order of two floating-point values |
8385
| [`isinf`](./reference/isinf.md) | Determines whether a floating-point value is infinite |
8486
| [`isnan`, `_isnan`, `_isnanf`](./reference/isnan-isnan-isnanf.md) | Tests a floating-point value for NaN |
8587
| [`isnormal`](./reference/isnormal.md) | Tests whether a floating-point value is both finite and not subnormal |

docs/cpp/import-export-module.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Use import and export declarations to access and to publish types a
77
---
88
# `module`, `import`, `export`
99

10-
The **`module`**, **`import`**, and **`export`** declarations are available in C++20 and require the compiler switch [`/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 compiler switch [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later. For more information, see [Overview of modules in C++](modules-cpp.md).
1111

1212
## `module`
1313

@@ -43,8 +43,6 @@ namespace ModuleA_NS
4343
Non-exported names aren't visible to code that imports the module:
4444

4545
```cpp
46-
//MyProgram.cpp
47-
4846
import ModuleA;
4947

5048
int main() {
@@ -64,9 +62,8 @@ Use an **`import`** declaration to make a module's names visible in your program
6462
module ModuleA;
6563

6664
#include "custom-lib.h"
67-
import std.core;
68-
import std.regex;
69-
import ModuleB;
65+
import std;
66+
import myModule;
7067

7168
// begin declarations here:
7269
template <class T>
@@ -114,4 +111,5 @@ import // Always an identifier, never a keyword
114111
115112
## See Also
116113
117-
[Overview of modules in C++](modules-cpp.md)
114+
[Overview of modules in C++](modules-cpp.md)\
115+
[Import the C++ standard library using modules](tutorial-import-stl-named-module.md)

docs/cpp/modules-cpp.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Overview of modules in C++"
33
description: Modules in C++20 provide a modern alternative to header files.
4-
ms.date: 02/11/2025
4+
ms.date: 04/17/2025
55
helpviewer_keywords: ["modules [C++]", "modules [C++], overview"]
66
---
77
# Overview of modules in C++
@@ -48,8 +48,8 @@ The file *`MyProgram.cpp`* uses **`import`** to access the name exported by `Exa
4848

4949
```cpp
5050
// MyProgram.cpp
51+
import std;
5152
import Example;
52-
import std.core;
5353

5454
using namespace std;
5555

@@ -156,7 +156,7 @@ You can include header files in a module source file by putting an `#include` di
156156
#include "customlib.h"
157157
#include "anotherlib.h"
158158

159-
import std.core;
159+
import std;
160160
import MyModuleB;
161161

162162
//... rest of file
@@ -166,9 +166,10 @@ You can use a traditional header file to control which modules are imported:
166166

167167
```cpp
168168
// MyProgram.h
169-
import std.core;
170-
#ifdef DEBUG_LOGGING
171-
import std.filesystem;
169+
#ifdef C_RUNTIME_GLOBALS
170+
import std.compat;
171+
#else
172+
import std;
172173
#endif
173174
```
174175

@@ -183,6 +184,7 @@ import "myheader.h";
183184

184185
## See also
185186

187+
[Import the C++ standard library using modules](tutorial-import-stl-named-module.md)\
186188
[`module`, `import`, `export`](import-export-module.md)\
187189
[Named modules tutorial](tutorial-named-modules-cpp.md)\
188190
[Compare header units, modules, and precompiled headers](../build/compare-inclusion-methods.md)

0 commit comments

Comments
 (0)