Skip to content

Commit 520ea9b

Browse files
author
mtx48109
committed
cpp formatting review pr24
1 parent d80994f commit 520ea9b

30 files changed

+60
-95
lines changed

docs/cpp/transporting-exceptions-between-threads.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ exception_ptr 1: Caught a myException exception.
245245
**Header:** \<exception>
246246

247247
## See also
248-
249-
- [Exception Handling](../cpp/exception-handling-in-visual-cpp.md)
250-
- [/EH (Exception Handling Model)](../build/reference/eh-exception-handling-model.md)
251-
- [/clr (Common Language Runtime Compilation)](../build/reference/clr-common-language-runtime-compilation.md)
248+
[Exception Handling](../cpp/exception-handling-in-visual-cpp.md)
249+
[/EH (Exception Handling Model)](../build/reference/eh-exception-handling-model.md)
250+
[/clr (Common Language Runtime Compilation)](../build/reference/clr-common-language-runtime-compilation.md)

docs/cpp/trivial-standard-layout-and-pod-types.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ struct Trivial2
4141
private:
4242
int j; // Different access control
4343
};
44-
4544
```
4645
4746
## Standard layout types
@@ -74,7 +73,6 @@ struct SL
7473
int j;
7574
SL(int a, int b) : i(a), j(b) {} // User-defined constructor OK
7675
};
77-
7876
```
7977

8078
The last two requirements can perhaps be better illustrated with code. In the next example, even though Base is standard-layout, `Derived` is not standard layout because both it (the most derived class) and `Base` have non-static data members:
@@ -180,7 +178,6 @@ int main()
180178

181179
return 0;
182180
}
183-
184181
```
185182

186183
## <a name="literal_types"></a> Literal types
@@ -193,6 +190,5 @@ A literal type is one whose layout can be determined at compile time. The follow
193190
- Arrays of void, scalar types or references
194191
- A class that has a trivial destructor, and one or more constexpr constructors that are not move or copy constructors. Additionally, all its non-static data members and base classes must be literal types and not volatile.
195192

196-
## See Also
197-
193+
## See also
198194
[Basic Concepts](../cpp/basic-concepts-cpp.md)

docs/cpp/true-cpp.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ ms.workload: ["cplusplus"]
1616
## Syntax
1717

1818
```
19-
2019
bool-identifier = true ;
2120
bool-expression logical-operator true ;
2221
```
@@ -43,5 +42,5 @@ int main()
4342
0
4443
```
4544

46-
## See Also
45+
## See also
4746
[Keywords](../cpp/keywords-cpp.md)

docs/cpp/try-except-statement.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ world
162162

163163
**END Microsoft Specific**
164164

165-
## See Also
166-
167-
[Writing an Exception Handler](../cpp/writing-an-exception-handler.md)
168-
[Structured Exception Handling (C/C++)](../cpp/structured-exception-handling-c-cpp.md)
169-
[Keywords](../cpp/keywords-cpp.md)
165+
## See also
166+
[Writing an Exception Handler](../cpp/writing-an-exception-handler.md)
167+
[Structured Exception Handling (C/C++)](../cpp/structured-exception-handling-c-cpp.md)
168+
[Keywords](../cpp/keywords-cpp.md)

docs/cpp/try-finally-statement.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
1515
# try-finally Statement
1616
**Microsoft Specific**
1717

18-
The following syntax describes the `try-finally` statement:
18+
The following syntax describes the **try-finally** statement:
1919

2020
```cpp
2121
__try {
@@ -32,7 +32,7 @@ __finally {
3232

3333
**__finally** *compound-statement*
3434

35-
The `try-finally` statement is a Microsoft extension to the C and C++ languages that enables target applications to guarantee execution of cleanup code when execution of a block of code is interrupted. Cleanup consists of such tasks as deallocating memory, closing files, and releasing file handles. The `try-finally` statement is especially useful for routines that have several places where a check is made for an error that could cause premature return from the routine.
35+
The **try-finally** statement is a Microsoft extension to the C and C++ languages that enables target applications to guarantee execution of cleanup code when execution of a block of code is interrupted. Cleanup consists of such tasks as deallocating memory, closing files, and releasing file handles. The **try-finally** statement is especially useful for routines that have several places where a check is made for an error that could cause premature return from the routine.
3636

3737
For related information and a code sample, see [try-except Statement](../cpp/try-except-statement.md). For more information on structured exception handling in general, see [Structured Exception Handling](../cpp/structured-exception-handling-c-cpp.md). For more information on handling exceptions in managed applications, see [Exception Handling under /clr](../windows/exception-handling-cpp-component-extensions.md).
3838

@@ -60,20 +60,20 @@ Order of Termination-Handler Execution
6060
> The behavior of try-finally is different from some other languages that support the use of **finally**, such as C#. A single **__try** may have either, but not both, of **__finally** and **__except**. If both are to be used together, an outer try-except statement must enclose the inner try-finally statement. The rules specifying when each block executes are also different.
6161
6262
## The __leave Keyword
63-
The **__leave** keyword is valid only within the guarded section of a `try-finally` statement, and its effect is to jump to the end of the guarded section. Execution continues at the first statement in the termination handler.
63+
The **__leave** keyword is valid only within the guarded section of a **try-finally** statement, and its effect is to jump to the end of the guarded section. Execution continues at the first statement in the termination handler.
6464

6565
A **goto** statement can also jump out of the guarded section, but it degrades performance because it invokes stack unwinding. The **__leave** statement is more efficient because it does not cause stack unwinding.
6666

6767
## Abnormal Termination
68-
Exiting a `try-finally` statement using the [longjmp](../c-runtime-library/reference/longjmp.md) run-time function is considered abnormal termination. It is illegal to jump into a **__try** statement, but legal to jump out of one. All **__finally** statements that are active between the point of departure (normal termination of the **__try** block) and the destination (the **__except** block that handles the exception) must be run. This is called a local unwind.
68+
Exiting a **try-finally** statement using the [longjmp](../c-runtime-library/reference/longjmp.md) run-time function is considered abnormal termination. It is illegal to jump into a **__try** statement, but legal to jump out of one. All **__finally** statements that are active between the point of departure (normal termination of the **__try** block) and the destination (the **__except** block that handles the exception) must be run. This is called a local unwind.
6969

7070
If a **try** block is prematurely terminated for any reason, including a jump out of the block, the system executes the associated **finally** block as a part of the process of unwinding the stack. In such cases, the [AbnormalTermination](http://msdn.microsoft.com/library/windows/desktop/ms679265) function returns **true** if called from within the **finally** block; otherwise, it returns **false**.
7171

72-
The termination handler is not called if a process is killed in the middle of executing a `try-finally` statement.
72+
The termination handler is not called if a process is killed in the middle of executing a **try-finally** statement.
7373

7474
**END Microsoft Specific**
7575

76-
## See Also
76+
## See also
7777
[Writing a Termination Handler](../cpp/writing-a-termination-handler.md)
7878
[Structured Exception Handling (C/C++)](../cpp/structured-exception-handling-c-cpp.md)
7979
[Keywords](../cpp/keywords-cpp.md)

docs/cpp/try-throw-and-catch-statements-cpp.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ To implement exception handling in C++, you use **try**, **throw**, and **catch*
2626
## Example
2727

2828
```cpp
29-
3029
MyData md;
3130
try {
3231
   // Code that could throw an exception
@@ -76,7 +75,7 @@ catch(...) {
7675
}
7776
```
7877

79-
## See Also
78+
## See also
8079
[C++ Exception Handling](../cpp/cpp-exception-handling.md)
8180
[Keywords](../cpp/keywords-cpp.md)
8281
[Unhandled C++ Exceptions](../cpp/unhandled-cpp-exceptions.md)

docs/cpp/type-conversions-and-type-safety-modern-cpp.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,13 @@ num2 = -1;
6666
num = num2;
6767
cout << "unsigned val = " << num << " signed val = " << num2 << endl;
6868
// Prints: unsigned val = 65535 signed val = -1
69-
7069
```
7170

7271
Notice that values are reinterpreted in both directions. If your program produces odd results in which the sign of the value seems inverted from what you expect, look for implicit conversions between signed and unsigned integral types. In the following example, the result of the expression ( 0 - 1) is implicitly converted from **int** to **unsigned int** when it's stored in `num`. This causes the bit pattern to be reinterpreted.
7372

7473
```cpp
7574
unsigned int u3 = 0 - 1;
7675
cout << u3 << endl; // prints 4294967295
77-
7876
```
7977

8078
The compiler does not warn about implicit conversions between signed and unsigned integral types. Therefore, we recommend that you avoid signed-to-unsigned conversions altogether. If you can't avoid them, then add to your code a runtime check to detect whether the value being converted is greater than or equal to zero and less than or equal to the maximum value of the signed type. Values in this range will transfer from signed to unsigned or from unsigned to signed without being reinterpreted.
@@ -84,7 +82,6 @@ cout << u3 << endl; // prints 4294967295
8482

8583
```cpp
8684
char* s = "Help" + 3;
87-
8885
```
8986

9087
## Explicit conversions (casts)
@@ -95,7 +92,6 @@ char* s = "Help" + 3;
9592
```cpp
9693
(int) x; // old-style cast, old-style syntax
9794
int(x); // old-style cast, functional syntax
98-
9995
```
10096

10197
The C-style cast operator is identical to the call operator () and is therefore inconspicuous in code and easy to overlook. Both are bad because they're difficult to recognize at a glance or search for, and they're disparate enough to invoke any combination of **static**, **const**, and **reinterpret_cast**. Figuring out what an old-style cast actually does can be difficult and error-prone. For all these reasons, when a cast is required, we recommend that you use one of the following C++ cast operators, which in some cases are significantly more type-safe, and which express much more explicitly the programming intent:
@@ -112,7 +108,6 @@ int(x); // old-style cast, functional syntax
112108
// No error but not necessarily safe.
113109
Base* b = new Base();
114110
Derived* d2 = static_cast<Derived*>(b);
115-
116111
```
117112

118113
For more information, see [static_cast](../cpp/static-cast-operator.md).
@@ -138,7 +133,6 @@ int(x); // old-style cast, functional syntax
138133
}
139134

140135
//Output: d3 is null;
141-
142136
```
143137

144138
For more information, see [dynamic_cast](../cpp/dynamic-cast-operator.md).
@@ -152,7 +146,6 @@ int(x); // old-style cast, functional syntax
152146
const double pi = 3.14;
153147
Func(const_cast<double&>(pi)); //No error.
154148
}
155-
156149
```
157150

158151
For more information, see [const_cast](../cpp/const-cast-operator.md).
@@ -172,12 +165,11 @@ int(x); // old-style cast, functional syntax
172165
// to do this?
173166
int k = reinterpret_cast<int>(str);// Programming intent is clear.
174167
// However, it is not 64-bit safe.
175-
176168
```
177169

178170
For more information, see [reinterpret_cast Operator](../cpp/reinterpret-cast-operator.md).
179171

180-
## See Also
172+
## See also
181173
[C++ Type System](../cpp/cpp-type-system-modern-cpp.md)
182174
[Welcome Back to C++](../cpp/welcome-back-to-cpp-modern-cpp.md)
183175
[C++ Language Reference](../cpp/cpp-language-reference.md)

docs/cpp/type-info-class.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ ms.author: "mblome"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# type_info Class
16-
The `type_info` class describes type information generated within the program by the compiler. Objects of this class effectively store a pointer to a name for the type. The `type_info` class also stores an encoded value suitable for comparing two types for equality or collating order. The encoding rules and collating sequence for types are unspecified and may differ between programs.
16+
The **type_info** class describes type information generated within the program by the compiler. Objects of this class effectively store a pointer to a name for the type. The **type_info** class also stores an encoded value suitable for comparing two types for equality or collating order. The encoding rules and collating sequence for types are unspecified and may differ between programs.
1717

18-
The `<typeinfo>` header file must be included in order to use the `type_info` class. The interface for the `type_info` class is:
18+
The `<typeinfo>` header file must be included in order to use the **type_info** class. The interface for the **type_info** class is:
1919

2020
```cpp
2121
class type_info {
@@ -30,11 +30,11 @@ public:
3030
};
3131
```
3232
33-
You cannot instantiate objects of the `type_info` class directly, because the class has only a private copy constructor. The only way to construct a (temporary) `type_info` object is to use the [typeid](../cpp/typeid-operator.md) operator. Since the assignment operator is also private, you cannot copy or assign objects of class `type_info`.
33+
You cannot instantiate objects of the **type_info** class directly, because the class has only a private copy constructor. The only way to construct a (temporary) **type_info** object is to use the [typeid](../cpp/typeid-operator.md) operator. Since the assignment operator is also private, you cannot copy or assign objects of class **type_info**.
3434
35-
`type_info::hash_code` defines a hash function suitable for mapping values of type `typeinfo` to a distribution of index values.
35+
`type_info::hash_code` defines a hash function suitable for mapping values of type **typeinfo** to a distribution of index values.
3636
37-
The operators `==` and `!=` can be used to compare for equality and inequality with other `type_info` objects, respectively.
37+
The operators `==` and `!=` can be used to compare for equality and inequality with other **type_info** objects, respectively.
3838
3939
There is no link between the collating order of types and inheritance relationships. Use the `type_info::before` member function to determine the collating sequence of types. There is no guarantee that `type_info::before` will yield the same result in different programs or even different runs of the same program. In this manner, `type_info::before` is similar to the address-of `(&)` operator.
4040
@@ -44,5 +44,5 @@ public:
4444
4545
Type information is generated for polymorphic classes only if the [/GR (Enable Run-Time Type Information)](../build/reference/gr-enable-run-time-type-information.md) compiler option is specified.
4646
47-
## See Also
48-
[Run-Time Type Information](../cpp/run-time-type-information.md)
47+
## See also
48+
[Run-Time Type Information](../cpp/run-time-type-information.md)

docs/cpp/typeid-operator.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ ms.workload: ["cplusplus"]
1515
## Syntax
1616

1717
```
18-
1918
typeid(type-id)
2019
typeid(expression)
2120
```
@@ -89,6 +88,6 @@ T max( T arg1, T arg2 ) {
8988
}
9089
```
9190
92-
## See Also
91+
## See also
9392
[Run-Time Type Information](../cpp/run-time-type-information.md)
9493
[Keywords](../cpp/keywords-cpp.md)

docs/cpp/typename.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ In template definitions, provides a hint to the compiler that an unknown identif
1818
## Syntax
1919

2020
```
21-
2221
typename identifier;
2322
```
2423

@@ -57,6 +56,6 @@ int main()
5756
}
5857
```
5958

60-
## See Also
59+
## See also
6160
[Templates](../cpp/templates-cpp.md)
6261
[Keywords](../cpp/keywords-cpp.md)

0 commit comments

Comments
 (0)