You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enables the [Auto-Parallelizer](../../parallel/auto-parallelization-and-auto-vectorization.md) feature of the compiler to automatically parallelize loops in your code.
10
+
Enables the [Auto-parallelizer](../../parallel/auto-parallelization-and-auto-vectorization.md) feature of the compiler to automatically parallelize loops in your code.
11
11
12
12
## Syntax
13
13
14
-
```
15
-
/Qpar
16
-
```
14
+
> **`/Qpar`**
17
15
18
16
## Remarks
19
17
20
-
When the compiler automatically parallelizes loops in code, it spreads computation across multiple processor cores. A loop is parallelized only if the compiler determines that it is legal to do so and that parallelization would improve performance.
18
+
When the compiler automatically parallelizes loops in code, it spreads computation across multiple processor cores. The compiler parallelizes a loop only if it determines that it's legal to do so and that parallelization would improve performance.
21
19
22
-
The `#pragma loop()` directives are available to help the optimizer parallelize specific loops. For more information, see [loop](../../preprocessor/loop.md).
20
+
The `#pragma loop()` directives are available to help the optimizer parallelize specific loops. For more information, see [`loop`](../../preprocessor/loop.md).
23
21
24
-
For information about how to enable output messages for the auto-parallelizer, see [/Qpar-report (Auto-Parallelizer Reporting Level)](qpar-report-auto-parallelizer-reporting-level.md).
22
+
For information about how to enable output messages for the auto-parallelizer, see [`/Qpar-report` (Auto-parallelizer reporting level)](qpar-report-auto-parallelizer-reporting-level.md).
25
23
26
-
### To set the /Qpar compiler option in Visual Studio
24
+
### To set the `/Qpar` compiler option in Visual Studio
27
25
28
26
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
The /STACKoption sets the size of the stack in bytes. Use this option only when you build an .exe file.
15
+
The **`/STACK`** linker option sets the size of the stack in bytes. Use this option only when you build an *`.exe`* file. The **`/STACK`** option is ignored when applied to *`.dll`* files.
18
16
19
-
The `reserve` value specifies the total stack allocation in virtual memory. For ARM, x86 and x64 machines, the default stack size is 1 MB.
17
+
The *`reserve`* value specifies the total stack allocation in virtual memory. For ARM64, x86, and x64 machines, the default stack size is 1 MB.
20
18
21
-
`commit`is subject to interpretation by the operating system. In Windows WindowsRT it specifies the amount of physical memory to allocate at a time. Committed virtual memory causes space to be reserved in the paging file. A higher `commit` value saves time when the application needs more stack space, but increases the memory requirements and possibly the startup time. For ARM, x86 and x64 machines, the default commit value is 4 KB.
19
+
The *`commit`* value is subject to interpretation by the operating system. In WindowsRT, it specifies the amount of physical memory to allocate at a time. Committed virtual memory causes space to be reserved in the paging file. A higher *`commit`* value saves time when the application needs more stack space, but increases the memory requirements and possibly the startup time. For ARM64, x86, and x64 machines, the default *`commit`* value is 4 KB.
22
20
23
-
Specify the `reserve` and `commit` values in decimal or C-language notation.
21
+
Specify the *`reserve`* and *`commit`* values in decimal or C-language hexadecimal notation (use a `0x` prefix).
24
22
25
-
Another way to set the size of the stack is with the [STACKSIZE](stacksize.md) statement in a module-definition (.def) file. **STACKSIZE** overrides the Stack Allocations (/STACK) option if both are specified. You can change the stack size after the .exe file is built by using the [EDITBIN](editbin-reference.md) tool.
23
+
Another way to set the size of the stack is with the [`STACKSIZE`](stacksize.md) statement in a module-definition (*`.def`*) file. **`STACKSIZE`** overrides the Stack Allocations (**`/STACK`**) option if both are specified. You can change the stack size after the *`.exe`* file is built by using the [`EDITBIN`](editbin-reference.md) tool.
26
24
27
25
### To set this linker option in the Visual Studio development environment
28
26
@@ -42,5 +40,5 @@ Another way to set the size of the stack is with the [STACKSIZE](stacksize.md) s
Copy file name to clipboardExpand all lines: docs/code-quality/clang-tidy.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
2
title: Using Clang-Tidy in Visual Studio
3
3
description: "How to use Clang-Tidy in Visual Studio for Microsoft C++ code analysis."
4
-
ms.date: 02/19/2020
4
+
ms.date: 02/22/2022
5
5
ms.topic: "conceptual"
6
6
f1_keywords: ["vs.codeanalysis.clangtidy"]
7
7
---
8
8
# Using Clang-Tidy in Visual Studio
9
9
10
10
::: moniker range="<=msvc-150"
11
11
12
-
Support for Clang-Tidy requires Visual Studio 2019 version 16.4 or later. To see the documentation for this version, set the Visual Studio **Version** selector control for this article to Visual Studio 2019. It's found at the top of the table of contents on this page.
12
+
Support for Clang-Tidy requires Visual Studio 2019 version 16.4 or later. To see the documentation for this version, set the Visual Studio **Version** selector control for this article to Visual Studio 2019 or later. It's found at the top of the table of contents on this page.
13
13
14
14
::: moniker-end
15
15
@@ -45,7 +45,7 @@ Clang-Tidy runs result in warnings displayed in the Error List, and as in-editor
45
45
46
46
## Clang-Tidy configuration
47
47
48
-
You can configure the checks that clang-tidy runs inside Visual Studio via the **Clang-Tidy Checks** option. This input is provided to the **`--checks`** argument of the tool. Any further configuration can be included in custom *`.clang-tidy`* files. For more information, see the [Clang-Tidy documentation on LLVM.org](https://clang.llvm.org/extra/clang-tidy/).
48
+
By default, Clang-Tidy runs the `clang-analyzer-*` checks when enabled. To see the list of checks, run `clang-tidy -list-checks` in a developer command prompt. You can configure the checks that clang-tidy runs inside Visual Studio via the **Clang-Tidy Checks** option. This input is provided to the **`--checks`** argument of the tool. Any further configuration can be included in custom *`.clang-tidy`* files. For more information, see the [Clang-Tidy documentation on LLVM.org](https://clang.llvm.org/extra/clang-tidy/).
Copy file name to clipboardExpand all lines: docs/cpp/declarations-and-definitions-cpp.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
description: "Learn more about: Declarations and definitions (C++)"
3
3
title: "Declarations and definitions (C++)"
4
-
ms.date: 07/23/2021
4
+
ms.date: 02/22/2022
5
5
---
6
6
# Declarations and definitions (C++)
7
7
@@ -18,8 +18,8 @@ int main()
18
18
{
19
19
const double pi = 3.14; //OK
20
20
int i = f(2); //OK. f is forward-declared
21
-
std::string str; // OK std::string is declared in <string> header
22
21
C obj; // error! C not yet declared.
22
+
std::string str; // OK std::string is declared in <string> header
23
23
j = 0; // error! No type specified.
24
24
auto k = 0; // OK. type inferred as int by compiler.
25
25
}
@@ -36,7 +36,7 @@ namespace N {
36
36
37
37
On line 5, the `main` function is declared. On line 7, a **`const`** variable named `pi` is declared and *initialized*. On line 8, an integer `i` is declared and initialized with the value produced by the function `f`. The name `f` is visible to the compiler because of the *forward declaration* on line 3.
38
38
39
-
In line 9, a variable named `obj` of type `C` is declared. However, this declaration raises an error because `C` isn't declared until later in the program, and isn't forward-declared. To fix the error, you can either move the entire *definition* of `C` before `main` or else add a forward-declaration for it. This behavior is different from other languages such as C#, in which functions and classes can be used before their point of declaration in a source file.
39
+
In line 9, a variable named `obj` of type `C` is declared. However, this declaration raises an error because `C` isn't declared until later in the program, and isn't forward-declared. To fix the error, you can either move the entire *definition* of `C` before `main` or else add a forward-declaration for it. This behavior is different from other languages such as C#. In those languages, functions and classes can be used before their point of declaration in a source file.
40
40
41
41
In line 10, a variable named `str` of type `std::string` is declared. The name `std::string` is visible because it's introduced in the `string` [header file](header-files-cpp.md), which is merged into the source file in line 1. `std` is the namespace in which the `string` class is declared.
42
42
@@ -82,25 +82,25 @@ In older versions of C++, the [`typedef`](aliases-and-typedefs-cpp.md) keyword i
82
82
83
83
## Static class members
84
84
85
-
Because static class data members are discrete variables that are shared by all objects of the class, they must be defined and initialized outside the class definition. (For more information, see [Classes](../cpp/classes-and-structs-cpp.md).)
85
+
Static class data members are discrete variables that are shared by all objects of the class. Because they're shared, they must be defined and initialized outside the class definition. For more information, see [Classes](../cpp/classes-and-structs-cpp.md).
86
86
87
87
## extern declarations
88
88
89
-
A C++ program might contain more than one [compilation unit](header-files-cpp.md). To declare an entity that is defined in a separate compilation unit, use the [`extern`](extern-cpp.md) keyword. The information in the declaration is sufficient for the compiler, but if the definition of the entity can't be found in the linking step, then the linker will raise an error.
89
+
A C++ program might contain more than one [compilation unit](header-files-cpp.md). To declare an entity that's defined in a separate compilation unit, use the [`extern`](extern-cpp.md) keyword. The information in the declaration is sufficient for the compiler. However, if the definition of the entity can't be found in the linking step, then the linker will raise an error.
90
90
91
91
## In this section
92
92
93
-
[Storage classes](storage-classes-cpp.md)<br/>
94
-
[`const`](const-cpp.md)<br/>
95
-
[`constexpr`](constexpr-cpp.md)<br/>
96
-
[`extern`](extern-cpp.md)<br/>
97
-
[Initializers](initializers.md)<br/>
98
-
[Aliases and typedefs](aliases-and-typedefs-cpp.md)<br/>
99
-
[`using` declaration](using-declaration.md)<br/>
100
-
[`volatile`](volatile-cpp.md)<br/>
101
-
[`decltype`](decltype-cpp.md)<br/>
102
-
[Attributes in C++](attributes.md)<br/>
93
+
[Storage classes](storage-classes-cpp.md)\
94
+
[`const`](const-cpp.md)\
95
+
[`constexpr`](constexpr-cpp.md)\
96
+
[`extern`](extern-cpp.md)\
97
+
[Initializers](initializers.md)\
98
+
[Aliases and typedefs](aliases-and-typedefs-cpp.md)\
To minimize the possibility of data corruption when exporting a class declared as [__declspec(dllexport)](../../cpp/dllexport-dllimport.md), ensure that:
15
+
To minimize the possibility of data corruption when exporting a class declared as [`__declspec(dllexport)`](../../cpp/dllexport-dllimport.md), ensure that:
16
16
17
17
- All your static data is accessed through functions that are exported from the DLL.
18
18
@@ -22,9 +22,9 @@ To minimize the possibility of data corruption when exporting a class declared a
22
22
23
23
- No methods of your class (whether inlined or not) can use types where the instantiation in the EXE and DLL have static data differences.
24
24
25
-
You can avoid issues when exporting a class from a DLL: Define your class to have virtual functions, and functions to instantiate and delete objects of the type. You can then just call virtual functions on the type.
25
+
You can avoid issues when exporting a class from a DLL: Define your class to have virtual functions, a virtual destructor, and functions to instantiate and delete objects of the type. You can then just call virtual functions on the type.
26
26
27
-
C4251 can be ignored if your class is derived from a type in the C++ Standard Library, you're compiling a debug release (**/MTd**), and where the compiler error message refers to `_Container_base`.
27
+
C4251 can be ignored if your class is derived from a type in the C++ Standard Library, you're compiling a debug release (**`/MTd`**), and where the compiler error message refers to `_Container_base`.
0 commit comments