Skip to content

Commit 68a9ba1

Browse files
Merge pull request #4914 from MicrosoftDocs/main638418903664006602sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 6283962 + 3fcb3ac commit 68a9ba1

File tree

2 files changed

+24
-27
lines changed

2 files changed

+24
-27
lines changed

docs/cpp/modules-cpp.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To consume the Microsoft Standard Library modules, compile your program with [`/
4747

4848
## Example
4949

50-
The following example shows a simple module definition in a source file called *`Example.ixx`*. The *`.ixx`* extension is required for module interface files in Visual Studio. In this example, the interface file contains both the function definition and the declaration. However, you can also place the definitions in one or more separate module implementation files, as shown in a later example. The `export module Example;` statement indicates that this file is the primary interface for a module called `Example`. The **`export`** modifier on `f()` indicates that this function is visible when `Example` is imported by another program or module. The module references a namespace `Example_NS`.
50+
The following example shows a simple module definition in a source file called *`Example.ixx`*. The *`.ixx`* extension is required for module interface files in Visual Studio. In this example, the interface file contains both the function definition and the declaration. However, you can also place the definitions in one or more separate module implementation files, as shown in a later example. The `export module Example;` statement indicates that this file is the primary interface for a module called `Example`. The **`export`** modifier on `f()` indicates that this function is visible when another program or module imports `Example`. The module references a namespace `Example_NS`.
5151

5252
```cpp
5353
// Example.ixx
@@ -109,15 +109,15 @@ The `import` declaration can appear only at global scope.
109109
110110
## Implementing modules
111111

112-
A *module interface* exports the module name and all the namespaces, types, functions, and so on that make up the public interface of the module. A *module implementation* defines the things exported by the module. In its simplest form, a module can consist of a single file that combines the module interface and implementation. You can also put the implementations in one or more separate module implementation files, similar to how *`.h`* and *`.cpp`* files are used.
112+
A *module interface* exports the module name and all the namespaces, types, functions, and so on, that make up the public interface of the module. A *module implementation* defines the things exported by the module. In its simplest form, a module can consist of a single file that combines the module interface and implementation. You can also put the implementation in one or more separate module implementation files, similar to how *`.h`* and *`.cpp`* files do it.
113113

114-
For larger modules, you can split parts of the module into submodules called *partitions*. Each partition consists of a module interface file that exports a module partition name. A partition might also have one or more partition implementation files. The module as a whole has one *primary module interface*, the public interface of the module that might also import and export the partition interfaces.
114+
For larger modules, you can split parts of the module into submodules called *partitions*. Each partition consists of a module interface file that exports a module partition name. A partition may also have one or more partition implementation files. The module as a whole has one *primary module interface*, which is the public interface of the module and may export the partition interfaces.
115115

116116
A module consists of one or more *module units*. A module unit is a translation unit (a source file) that contains a module declaration. There are several types of module units:
117117

118118
- A *module interface unit* is a module unit that exports a module name or module partition name. A module interface unit has `export module` in its module declaration.
119119

120-
- A *module implementation unit* is a module unit that doesn't export a module name or module partition name. As the name implies, it's used to implement a module.
120+
- A *module implementation unit* is a module unit that doesn't export a module name or module partition name. As the name implies, it implements a module.
121121

122122
- A *primary module interface unit* is a module interface unit that exports the module name. There must be one and only one primary module interface unit in a module.
123123

@@ -131,7 +131,7 @@ The **`export`** keyword is used in interface files only. An implementation file
131131

132132
The rules for namespaces in modules are the same as in any other code. If a declaration within a namespace is exported, the enclosing namespace (excluding nonexported members) is also implicitly exported. If a namespace is explicitly exported, all declarations within that namespace definition are exported.
133133

134-
When it does argument-dependent lookup for overload resolutions in the importing translation unit, the compiler considers functions declared in the same translation unit (including module interfaces) as where the type of the function's arguments are defined.
134+
When the compiler does argument-dependent lookup for overload resolutions in the importing translation unit, it considers functions declared in the same translation unit (including module interfaces) as where the type of the function's arguments are defined.
135135

136136
### Module partitions
137137

0 commit comments

Comments
 (0)