Skip to content

Commit 9a39742

Browse files
author
Colin Robertson
committed
Acrolinx fixes
1 parent 6b30ca6 commit 9a39742

File tree

6 files changed

+23
-25
lines changed

6 files changed

+23
-25
lines changed

docs/build/customize-cmake-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ usage: ninja [options] [targets...]
125125
| -n | dry run (don't run commands but act like they succeeded)|
126126
| -v | show all command lines while building|
127127
| -d MODE | enable debugging (use -d list to list modes)|
128-
| -t TOOL | run a subtool (use -t list to list subtools). terminates toplevel options; further flags are passed to the tool|
128+
| -t TOOL | run a subtool (use -t list to list subtools). terminates top-level options; further flags are passed to the tool|
129129
| -w FLAG | adjust warnings (use -w list to list warnings)|
130130

131131
## Inherited environments

docs/build/reference/file-types-created-for-visual-cpp-projects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The following table shows common files in a Visual Studio project, and identifie
3737
|.atp|Project|Application template project file.|
3838
|.bmp, .dib, .gif, .jpg, .jpe, .png|Resource|General image files.|
3939
|.bsc|Compiling|The browser code file.|
40-
|.cpp; .c|Source|Main source code files for your application.|
40+
|.cpp, .c|Source|Main source code files for your application.|
4141
|.cur|Resource|Cursor bitmap graphic file.|
4242
|.dbp|Project|Database project file.|
4343
|.disco|Source|The dynamic discovery document file. Handles XML Web service discovery.|

docs/cpp/constexpr-cpp.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,31 @@ ms.assetid: c6458ccb-51c6-4a16-aa61-f69e6f4e04f7
66
---
77
# constexpr (C++)
88

9-
The keyword **constexpr** was introduced in C++11 and improved in C++14. It means *constant expression*. Like **const**, it can be applied to variables so that a compiler error will be raised if any code attempts to modify the value. Unlike **const**, **constexpr** can also be applied to functions and class constructors. **constexpr** indicates that the value, or return value, is constant and, if possible, will be computed at compile time.
9+
The keyword **constexpr** was introduced in C++11 and improved in C++14. It means *constant expression*. Like **const**, it can be applied to variables so that a compiler error is raised if any code attempts to modify the value. Unlike **const**, **constexpr** can also be applied to functions and class constructors. **constexpr** indicates that the value, or return value, is constant and, if possible, is computed at compile time.
1010

1111
A **constexpr** integral value can be used wherever a const integer is required, such as in template arguments and array declarations. And when a value can be computed at compile time instead of run time, it can help your program run faster and use less memory.
1212

13-
To limit the complexity of computing compile time constants, and their potential impacts of compilation time, the C++14 standard requires that the types involved in constant expressions be restricted to [literal types](trivial-standard-layout-and-pod-types.md#literal_types).
13+
To limit the complexity of compile-time constant computations, and their potential impacts on compilation time, the C++14 standard requires the types in constant expressions to be [literal types](trivial-standard-layout-and-pod-types.md#literal_types).
1414

1515
## Syntax
1616

17-
```
18-
constexpr literal-type identifier = constant-expression;
19-
constexpr literal-type identifier { constant-expression };
20-
constexpr literal-type identifier(params );
21-
constexpr ctor (params);
22-
```
17+
> **constexpr** *literal-type* *identifier* **=** *constant-expression* **;**
18+
> **constexpr** *literal-type* *identifier* **{** *constant-expression* **}** **;**
19+
> **constexpr** *literal-type* *identifier* **(** *params* **)** **;**
20+
> **constexpr** *ctor* **(** *params* **)** **;**
2321
2422
## Parameters
2523

2624
*params*<br/>
27-
One or more parameters which must be a literal type and must itself be a constant expression.
25+
One or more parameters, each of which must be a literal type and must itself be a constant expression.
2826

2927
## Return Value
3028

3129
A constexpr variable or function must return a [literal type](trivial-standard-layout-and-pod-types.md#literal_types).
3230

3331
## constexpr variables
3432

35-
The primary difference between const and constexpr variables is that the initialization of a const variable can be deferred until run time whereas a constexpr variable must be initialized at compile time. All constexpr variables are const.
33+
The primary difference between const and constexpr variables is that the initialization of a const variable can be deferred until run time. A constexpr variable must be initialized at compile time. All constexpr variables are const.
3634

3735
- A variable can be declared with **constexpr**, if it has a literal type and is initialized. If the initialization is performed by a constructor, the constructor must be declared as **constexpr**.
3836

@@ -51,7 +49,7 @@ constexpr int k = j + 1; //Error! j not a constant expression
5149
5250
## <a name="constexpr_functions"></a> constexpr functions
5351
54-
A **constexpr** function is one whose return value can be computed at compile when consuming code requires it. When its arguments are **constexpr** values, and consuming code requires the return value at compile time, for example to initialize a **constexpr** variable or provide a non-type template argument, it produces a compile-time constant. When called with non-**constexpr** arguments, or when its value is not required at compile-time, it produces a value at run time like a regular function. (This dual behavior saves you from having to write **constexpr** and non-**constexpr** versions of the same function.)
52+
A **constexpr** function is one whose return value can be computed at compile time when consuming code requires it. Consuming code requires the return value at compile time, for example, to initialize a **constexpr** variable or provide a non-type template argument. When its arguments are **constexpr** values, a **constexpr** function produces a compile-time constant. When called with non-**constexpr** arguments, or when its value isn't required at compile-time, it produces a value at run time like a regular function. (This dual behavior saves you from having to write **constexpr** and non-**constexpr** versions of the same function.)
5553
5654
A **constexpr** function or constructor is implicitly **inline**.
5755
@@ -61,7 +59,7 @@ The following rules apply to constexpr functions:
6159
6260
- A **constexpr** function can be recursive.
6361
64-
- It cannot be [virtual](../cpp/virtual-cpp.md). A a constructor cannot be defined as constexpr if the enclosing class has any virtual base classes.
62+
- It cannot be [virtual](../cpp/virtual-cpp.md). A constructor cannot be defined as constexpr if the enclosing class has any virtual base classes.
6563
6664
- The body can be defined as `= default` or `= delete`.
6765
@@ -75,7 +73,7 @@ The following rules apply to **constexpr** functions in Visual Studio 2017 and l
7573
7674
- It may contain **if** and **switch** statements, and all looping statements including **for**, range-based for, **while**, and **do-while**.
7775
78-
- It may contain local variable declarations, but the variable must be initialized, must be a literal type, and cannot be static or thread-local. The locally-declared variable is not required to be const and may mutate.
76+
- It may contain local variable declarations, but the variable must be initialized, must be a literal type, and cannot be static or thread-local. The locally declared variable isn't required to be const and may mutate.
7977
8078
- A constexpr non-static member function is not required to be implicitly const.
8179
@@ -89,15 +87,15 @@ constexpr float exp(float x, int n)
8987
```
9088

9189
> [!TIP]
92-
> Note: In the Visual Studio debugger, when debugging a non-optimised Debug build, you can tell whether a **constexpr** function is being evaluated at compile time by putting a breakpoint inside it. If the breakpoint is hit, the function was called at run-time. If not, then the function was called at compile time.
90+
> In the Visual Studio debugger, when debugging a non-optimised Debug build, you can tell whether a **constexpr** function is being evaluated at compile time by putting a breakpoint inside it. If the breakpoint is hit, the function was called at run-time. If not, then the function was called at compile time.
9391
9492
## extern constexpr
9593

9694
The [/Zc:externConstexpr](../build/reference/zc-externconstexpr.md) compiler option causes the compiler to apply [external linkage](../c-language/external-linkage.md) to variables declared by using **extern constexpr**. In earlier versions of Visual Studio, and by default or if **/Zc:externConstexpr-** is specified, Visual Studio applies internal linkage to **constexpr** variables even if the **extern** keyword is used. The **/Zc:externConstexpr** option is available starting in Visual Studio 2017 Update 15.6. and is off by default. The /permissive- option does not enable /Zc:externConstexpr.
9795

9896
## Example
9997

100-
The following example shows **constexpr** variables, functions and a user-defined type. Note that in the last statement in main(), the **constexpr** member function GetValue() is a run-time call because the value is not required to be known at compile time.
98+
The following example shows **constexpr** variables, functions, and a user-defined type. In the last statement in main(), the **constexpr** member function GetValue() is a run-time call because the value isn't required to be known at compile time.
10199

102100
```cpp
103101
#include <iostream>
@@ -120,7 +118,7 @@ constexpr float exp2(const float& x, const int& n)
120118
exp2(x * x, (n - 1) / 2) * x;
121119
};
122120

123-
// Compile time computation of array length
121+
// Compile-time computation of array length
124122
template<typename T, int N>
125123
constexpr int length(const T(&ary)[N])
126124
{
@@ -148,19 +146,19 @@ private:
148146

149147
int main()
150148
{
151-
//foo is const:
149+
// foo is const:
152150
constexpr Foo foo(5);
153151
// foo = Foo(6); //Error!
154152

155-
//Compile time:
153+
// Compile time:
156154
constexpr float x = exp(5, 3);
157155
constexpr float y { exp(2, 5) };
158156
constexpr int val = foo.GetValue();
159157
constexpr int f5 = fac(5);
160158
const int nums[] { 1, 2, 3, 4 };
161159
const int nums2[length(nums) * 2] { 1, 2, 3, 4, 5, 6, 7, 8 };
162160

163-
//Run time:
161+
// Run time:
164162
cout << "The value of foo is " << foo.GetValue() << endl;
165163

166164
}

docs/cppcx/visual-c-language-reference-c-cx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ By using C++/CX, you can create:
2626
|-|-|
2727
|[Quick Reference](../cppcx/quick-reference-c-cx.md)|Table of keywords and operators for C++/CX.|
2828
|[Type System](../cppcx/type-system-c-cx.md)|Describes basic C++/CX types and programming constructs, and how to utilize C++/CX to consume and create Windows Runtime types.|
29-
|[Building apps and libraries](../cppcx/building-apps-and-libraries-c-cx.md)|Discusses how to use the IDE to build apps and link to static libraries aned DLLs.|
29+
|[Building apps and libraries](../cppcx/building-apps-and-libraries-c-cx.md)|Discusses how to use the IDE to build apps and link to static libraries and DLLs.|
3030
|[Interoperating with Other Languages](../cppcx/interoperating-with-other-languages-c-cx.md)|Discusses how components that are written by using C++/CX can be used with components that are written in JavaScript, any managed language, or the Windows Runtime C++ Template Library.|
3131
|[Threading and Marshaling](../cppcx/threading-and-marshaling-c-cx.md)|Discusses how to specify the threading and marshaling behavior of components that you create.|
3232
|[Namespaces Reference](../cppcx/namespaces-reference-c-cx.md)|Reference documentation for the default namespace, the Platform namespace, Platform::Collections, and related namespaces.|

docs/data/oledb/irowsetchangeimpl-class.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The storage unit for all row handles held by the provider.
5656
5757
|||
5858
|-|-|
59-
|[FlushData](#flushdata)|Overidden by provider to commit data to its store.|
59+
|[FlushData](#flushdata)|Overridden by provider to commit data to its store.|
6060
6161
## Remarks
6262
@@ -127,7 +127,7 @@ See [IRowsetChange::SetData](/previous-versions/windows/desktop/ms721232(v=vs.85
127127

128128
## <a name="flushdata"></a> IRowsetChangeImpl::FlushData
129129

130-
Overidden by provider to commit data to its store.
130+
Overridden by provider to commit data to its store.
131131

132132
### Syntax
133133

docs/mfc/reference/cdatabase-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void Cancel();
140140

141141
### Remarks
142142

143-
Note that the MFC ODBC classes no longer use asynchronous processing; to perform an asychronous operation, you must directly call the ODBC API function [SQLSetConnectOption](/sql/odbc/reference/syntax/sqlsetconnectoption-function). For more information, see [Asynchronous Execution](/sql/odbc/reference/develop-app/asynchronous-execution).
143+
Note that the MFC ODBC classes no longer use asynchronous processing; to perform an asynchronous operation, you must directly call the ODBC API function [SQLSetConnectOption](/sql/odbc/reference/syntax/sqlsetconnectoption-function). For more information, see [Asynchronous Execution](/sql/odbc/reference/develop-app/asynchronous-execution).
144144

145145
## <a name="cantransact"></a> CDatabase::CanTransact
146146

0 commit comments

Comments
 (0)