Skip to content

Repo sync for protected CLA branch #3914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/build/reference/scandependencies.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "/scanDependencies (List module and header unit dependencies per Standard)"
description: "Reference guide to the /scanDependencies compiler option in Microsoft C++."
ms.date: 02/01/2022
ms.date: 05/19/2022
author: "corob-msft"
ms.author: "corob"
f1_keywords: ["/scanDependencies"]
Expand All @@ -13,9 +13,9 @@ This compiler option generates a JSON file that lists module and header-unit dep

The **`/scanDependencies`** compiler option identifies which modules and header units need to be compiled before you can compile the project that uses them. For instance, it lists `import <library>;` or `import "library";` as a header unit dependency, and `import name;` as a module dependency. The intent is to provide this information in a common format consumable by build tools such as CMake.

This command-line option is similar to [`/sourceDependencies-directives`](sourcedependencies-directives.md) and [`/sourceDependencies`](sourcedependencies.md), but differs in the following ways:
This command-line option is similar to [`/sourceDependencies:directives`](sourcedependencies-directives.md) and [`/sourceDependencies`](sourcedependencies.md), but differs in the following ways:

- The output uses the [`P1689R4`](https://wg21.link/P1689r4) schema, instead of the Microsoft-specific schema generated by **`/sourceDependencies-directives`**.
- The output uses the [`P1689R4`](https://wg21.link/P1689r4) schema, instead of the Microsoft-specific schema generated by **`/sourceDependencies:directives`**.
- Unlike **`/sourceDependencies`**, the compiler doesn't produce compiled output. Instead, the files are scanned for module directives. No compiled code, modules, or header units are produced.
- The output JSON file doesn't list imported modules and imported header units (*`.ifc`* files) because this option only scans the project files. There are no built modules or header units to list.
- Only directly imported modules or header units are listed. It doesn't list the dependencies of the imported modules or header units themselves.
Expand All @@ -24,26 +24,26 @@ This command-line option is similar to [`/sourceDependencies-directives`](source

## Syntax

> **`/scanDependencies`** -\
> **`/scanDependencies-`**\
> **`/scanDependencies`** *`filename`*\
> **`/scanDependencies`** *`directory`*\
> **`/scanDependencies`** *`directory`*

## Arguments

*`-`*\
If the single dash is provided, then the compiler emits the source dependencies JSON to `stdout`, or to where compiler output is redirected.

*`filename`*\
The compiler writes the source dependency output to the specified filename, which may include a relative or absolute path.
The compiler writes the source dependency output to the specified filename, which may include a relative or absolute path. The file is created if it doesn't exist.

*`directory`*\
If the argument is a directory, the compiler generates source dependency files in the specified directory. The output file name is based on the full name of the input file, with an appended *`.module.json`* extension. For example, if the file provided to the compiler is *`main.cpp`*, the generated output filename is *`main.cpp.module.json`*.
If the argument is a directory, the compiler generates source dependency files in the specified directory. The directory must exist, or the argument is treated as a *`filename`*. The output file name is based on the full name of the input file, with an appended *`.module.json`* extension. For example, if the file provided to the compiler is *`main.cpp`*, the generated output filename is *`main.cpp.module.json`*.

## Remarks

**`/scanDependencies`** is available starting in Visual Studio 2022 version 17.2 preview 1. It's not enabled by default.

When you specify the **`/MP`** compiler option, we recommend you use **`/scanDependencies`** with a directory argument. If you provide a single filename argument, two instances of the compiler may attempt to open the output file simultaneously and cause an error. For more information on **`/MP`**, see [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md).
When you specify the [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md) compiler option, we recommend you use **`/scanDependencies`** with a directory argument. If you provide a single filename argument, two instances of the compiler may attempt to open the output file simultaneously and cause an error. Use of **`/MP`** with **`/scanDependencies-`** to send output to `stdout` could cause interleaved results.

When a non-fatal compiler error occurs, the dependency information still gets written to the output file.

Expand Down Expand Up @@ -132,6 +132,6 @@ You normally shouldn't set this option yourself in the Visual Studio development

[MSVC compiler options](compiler-options.md)\
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)\
[`/sourceDependencies-directives`](sourcedependencies-directives.md)\
[`/sourceDependencies:directives`](sourcedependencies-directives.md)\
[`/sourceDependencies`](sourcedependencies.md)\
[`/translateInclude`](translateinclude.md)
16 changes: 8 additions & 8 deletions docs/build/reference/sourcedependencies-directives.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "/sourceDependencies:directives (List module and header unit dependencies)"
description: "Reference guide to the /sourceDependencies:directives compiler option in Microsoft C++."
ms.date: 02/02/2022
ms.date: 05/19/2022
author: "tylermsft"
ms.author: "twhitney"
f1_keywords: ["/sourceDependencies:directives"]
Expand All @@ -23,26 +23,26 @@ This option differs from [`/sourceDependencies`](sourcedependencies.md) in the f

## Syntax

> **`/sourceDependencies:directives`** -\
> **`/sourceDependencies:directives-`**\
> **`/sourceDependencies:directives`** *filename*\
> **`/sourceDependencies:directives`** *directory*\
> **`/sourceDependencies:directives`** *directory*

## Arguments

*`-`*\
If the single dash is provided, then the compiler will emit the source dependencies JSON to `stdout`, or to where compiler output is redirected to.
If the single dash is provided, then the compiler will emit the source dependencies JSON to `stdout`, or to where compiler output is redirected.

*`filename`*\
The compiler writes the source dependency output to the specified filename, which may include a relative or absolute path.
The compiler writes the source dependency output to the specified filename, which may include a relative or absolute path. The file is created if it doesn't exist.

*`directory`*\
If the argument is a directory, the compiler generates source dependency files in the specified directory. The output file name is based on the full name of the input file, with an appended *`.json`* extension. For example, if the file provided to the compiler is *`main.cpp`*, the generated output filename is *`main.cpp.json`*.
If the argument is a directory, the compiler generates source dependency files in the specified directory. The directory must exist, or the argument is treated as a *`filename`*. The output file name is based on the full name of the input file, with an appended *`.json`* extension. For example, if the file provided to the compiler is *`main.cpp`*, the generated output filename is *`main.cpp.json`*.

## Remarks

**`/sourceDependencies:directives`** is available starting in Visual Studio 2019 version 16.10.

When you specify the [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md) compiler option, we recommend you use **`/sourceDependencies:directives`** with a directory argument. This option makes the compiler output a separate *`*.module.json`* file for each source file. If you provide a single filename argument, two instances of the compiler may attempt to open the output file simultaneously and cause an error.
When you specify the [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md) compiler option, we recommend that you use **`/sourceDependencies:directives`** with a directory argument. This option makes the compiler output a separate *`*.module.json`* file for each source file. If you provide a single filename argument, two instances of the compiler may attempt to open the output file simultaneously and cause an error. Use of **`/MP`** with **`/sourceDependencies:directives-`** to send output to `stdout` could cause interleaved results.

When a non-fatal compiler error occurs, the dependency information still gets written to the output file.

Expand Down Expand Up @@ -100,7 +100,7 @@ No *`.ifc`* files are listed in the output because they weren't built. Unlike `/

## To set this compiler option in Visual Studio

You normally shouldn't set this yourself in the Visual Studio development environment. It's set by the build system.
You normally shouldn't set this option yourself in the Visual Studio development environment. It's set by the build system.

## See also

Expand Down
29 changes: 15 additions & 14 deletions docs/build/reference/sourcedependencies.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "/sourceDependencies (Report source-level dependencies)"
description: "Describes the /sourceDependencies compiler option in Microsoft C++."
ms.date: 04/13/2020
ms.date: 05/19/2022
author: "tylermsft"
ms.author: "twhitney"
f1_keywords: ["/sourceDependencies"]
Expand All @@ -14,32 +14,32 @@ This command-line switch generates a JSON file that details the source-level dep
- Header files. Both directly included and the list of headers included by those headers.
- The PCH used (if **`/Yu`** is specified).
- Names of imported modules
- File paths and names of imported header units. Both directly imported and those imported by those modules and headers units.
- File paths and names of both directly imported header units and of the modules and header units they import in turn.

This provides information necessary to build modules and header units in the proper dependency order.
This option provides information necessary to build modules and header units in the proper dependency order.

## Syntax

> **`/sourceDependencies`** -\
> **`/sourceDependencies-`**\
> **`/sourceDependencies`** *filename*\
> **`/sourceDependencies`** *directory*

## Arguments

*`-`*\
If the single dash is provided, then the compiler will emit the source dependencies JSON to `stdout`, or to where compiler output is redirected to.
If the single dash is provided, then the compiler will emit the source dependencies JSON to `stdout`, or to where compiler output is redirected.

*`filename`*\
The compiler writes the source dependency output to the specified filename, which may include a relative or absolute path.
The compiler writes the source dependency output to the specified filename, which may include a relative or absolute path. The file is created if it doesn't exist.

*`directory`*\
If the argument is a directory, the compiler generates source dependency files in the specified directory. The output file name is based on the full name of the input file, with an appended *`.json`* extension. For example, if the file provided to the compiler is *`main.cpp`*, the generated output filename is *`main.cpp.json`*.
If the argument is a directory, the compiler generates source dependency files in the specified directory. The directory must exist, or the argument is treated as a *`filename`*. The output file name is based on the full name of the input file, with an appended *`.json`* extension. For example, if the file provided to the compiler is *`main.cpp`*, the generated output filename is *`main.cpp.json`*.

## Remarks

The **`/sourceDependencies`** compiler option is available starting in Visual Studio 2019 version 16.7. It's not enabled by default.

When you specify the **`/MP`** compiler option, we recommend you use **`/sourceDependencies`** with a directory argument. If you provide a single filename argument, two instances of the compiler may attempt to open the output file simultaneously and cause an error. For more information on **`/MP`**, see [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md).
When you specify the [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md) compiler option, we recommend you use **`/sourceDependencies`** with a directory argument. If you provide a single filename argument, two instances of the compiler may attempt to open the output file simultaneously and cause an error. Use of **`/MP`** with **`/sourceDependencies-`** to send output to `stdout` could cause interleaved results.

When a non-fatal compiler error occurs, the dependency information still gets written to the output file.

Expand All @@ -61,7 +61,7 @@ You can use **`/sourceDependencies`** with the rest of your compiler options:

> `cl ... /sourceDependencies output.json ... main.cpp`

where `...` represents your other compiler options. This command line produces a JSON file *`output.json`* with content like:
where `...` represents your other compiler options. This command line produces a JSON file *`output.json`* with content like:

```JSON
{
Expand Down Expand Up @@ -98,16 +98,17 @@ where `...` represents your other compiler options. This command line produces a
}
```

We've used `...` to abbreviate the reported paths. The report will contain the absolute paths. The paths reported depend on where the compiler finds the dependencies. If the results are unexpected, you may want to check your project's include path settings.
We've used `...` to abbreviate the reported paths. The report contains the absolute paths. The paths reported depend on where the compiler finds the dependencies. If the results are unexpected, you may want to check your project's include path settings.

`ProvidedModule` lists exported module or module partition names.

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

You normally shouldn't set this yourself in the Visual Studio development environment. It is set by the build system.
You normally shouldn't set this option yourself in the Visual Studio development environment. It's set by the build system.

## See also

[MSVC compiler options](compiler-options.md)<br/>
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)<br/>
[`/scanDependencies` (List module dependencies in standard form)](scandependencies.md)
[MSVC compiler options](compiler-options.md)\
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)\
[`/scanDependencies`](scandependencies.md)\
[`/sourceDependencies:directives`](sourcedependencies-directives.md)
4 changes: 2 additions & 2 deletions docs/standard-library/basic-istringstream-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ An rvalue reference of a `basic_istringstream` object.

### Remarks

The first constructor initializes the base class by calling [basic_istream](../standard-library/basic-istream-class.md)(`sb`), where `sb` is the stored object of class [basic_stringbuf](../standard-library/basic-stringbuf-class.md)< `Elem`, `Tr`, `Alloc`>. It also initializes `sb` by calling `basic_stringbuf`< `Elem`, `Tr`, `Alloc`>( `_Mode` &#124; `ios_base::in`).
The first constructor initializes the base class by calling `basic_istream]( sb )`, where `sb` is the stored object of class `basic_stringbuf< Elem, Tr, Alloc>`. It also initializes `sb` by calling `basic_stringbuf< Elem, Tr, Alloc >( _Mode | ios_base::in )`. For more information, see [`basic_istream`](../standard-library/basic-istream-class.md) and [`basic_stringbuf`](../standard-library/basic-stringbuf-class.md).

The second constructor initializes the base class by calling `basic_istream(sb)`. It also initializes `sb` by calling `basic_stringbuf`< `Elem`, `Tr`, `Alloc`>( `str`, `_Mode` &#124; `ios_base::in`).
The second constructor initializes the base class by calling `basic_istream( sb )`. It also initializes `sb` by calling `basic_stringbuf< Elem, Tr, Alloc >( str, _Mode | ios_base::in )`.

The third constructor initializes the object with the contents of *right*, treated as an rvalue reference.

Expand Down
4 changes: 2 additions & 2 deletions docs/standard-library/basic-ostringstream-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ An object of type `basic_string`.

### Remarks

The first constructor initializes the base class by calling [basic_ostream](../standard-library/basic-ostream-class.md)( **sb**), where `sb` is the stored object of class [basic_stringbuf](../standard-library/basic-stringbuf-class.md)< **Elem**, **Tr**, `Alloc`>. It also initializes **sb** by calling basic_stringbuf< **Elem**, **Tr**, `Alloc`>( `_Mode` &#124; `ios_base::out`).
The first constructor initializes the base class by calling `basic_ostream( sb )`, where `sb` is the stored object of class `basic_stringbuf< Elem, Tr, Alloc>`. It also initializes `sb` by calling `basic_stringbuf< Elem, Tr, Alloc>( _Mode | ios_base::out )`. For more information, see [`basic_ostream`](../standard-library/basic-ostream-class.md) and [`basic_stringbuf`](../standard-library/basic-stringbuf-class.md).

The second constructor initializes the base class by calling basic_ostream( **sb**). It also initializes `sb` by calling basic_stringbuf< **Elem**, **Tr**, `Alloc`>(_ *Str*, `_Mode` &#124; `ios_base::out`).
The second constructor initializes the base class by calling `basic_ostream( sb )`. It also initializes `sb` by calling `basic_stringbuf< Elem, Tr, Alloc >( str, _Mode | ios_base::out )`.

## <a name="rdbuf"></a> basic_ostringstream::rdbuf

Expand Down
4 changes: 2 additions & 2 deletions docs/standard-library/bitset-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ bitset 2: 0011
bitset 3: 0110
```

## <a name="op_or"></a> operator&#124;
## <a name="op_or"></a> `operator|`

Performs a bitwise `OR` between two bitsets.
Performs a bitwise OR between two `bitset` objects.

```cpp
template <size_t size>
Expand Down
2 changes: 1 addition & 1 deletion docs/standard-library/bitset.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Defines the class template bitset and two supporting template functions for repr
|[operator<\<](../standard-library/bitset-operators.md#op_lt_lt)|Inserts a text representation of the bit sequence into the standard output stream.|
|[operator>>](../standard-library/bitset-operators.md#op_gt_gt)|Inserts a text representation of the bit sequence into the standard input stream.|
|[operator^](../standard-library/bitset-operators.md#op_xor)|Performs a bitwise EXCLUSIVE-OR between two bitsets.|
|[operator&#124;](../standard-library/bitset-operators.md#op_or)|Performs a bitwise OR between two bitsets.|
|[`operator|`](../standard-library/bitset-operators.md#op_or)|Performs a bitwise OR between two bitsets.|

### Classes

Expand Down
5 changes: 2 additions & 3 deletions docs/standard-library/complex-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The modulus of a complex number.

### Remarks

The *modulus* of a complex number is a measure of the length of the vector representing the complex number. The modulus of a complex number a + bi is sqrt (a<sup>2</sup> + b<sup>2</sup>), written &#124;a + bi&#124;. The *norm* of a complex number a + bi is (a<sup>2</sup> + b<sup>2</sup>), so the modulus of a complex number is the square root of its norm.
The *modulus* of a complex number is a measure of the length of the vector representing the complex number. The modulus of a complex number *a + bi* is the square root of (*a*<sup>2</sup> + *b*<sup>2</sup>), written \|*a + bi*\|. The *norm* of a complex number *a + bi* is (*a*<sup>2</sup> + *b*<sup>2</sup>). The norm of a complex number is the square of its modulus.

### Example

Expand Down Expand Up @@ -758,8 +758,7 @@ The norm of a complex number.

### Remarks

The norm of a complex number *a + bi* is *(a*<sup>2</sup> *+ b*<sup>2</sup>*).* The norm of a complex number is the square of its modulus. The modulus of a complex number is a measure of the length of the vector representing the complex number. The modulus of a complex number *a + bi* is `sqrt`*(a*<sup>2</sup> *+ b*<sup>2</sup>*),* written *&#124;a + bi&#124;.*

The *norm* of a complex number *a + bi* is (*a*<sup>2</sup> + *b*<sup>2</sup>). The norm of a complex number is the square of its modulus. The *modulus* of a complex number is a measure of the length of the vector representing the complex number. The modulus of a complex number *a + bi* is the square root of (*a*<sup>2</sup> + *b*<sup>2</sup>), written \|*a + bi*\|.
### Example

```cpp
Expand Down
Loading