Skip to content

Commit 946725c

Browse files
author
mtx48109
committed
format cpp pr7
1 parent 8fc0df5 commit 946725c

30 files changed

+103
-103
lines changed

docs/cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ i++;
2929

3030
The effect of applying the postfix increment operator (`++`) is that the operand's value is increased by one unit of the appropriate type. Similarly, the effect of applying the postfix decrement operator (**--**) is that the operand's value is decreased by one unit of the appropriate type.
3131

32-
It is important to note that a postfix increment or decrement expression evaluates to the value of the expression **prior to** application of the respective operator. The increment or decrement operation occurs **after** the operand is evaluated. This issue arises only when the postfix increment or decrement operation occurs in the context of a larger expression.
32+
It is important to note that a postfix increment or decrement expression evaluates to the value of the expression *prior to* application of the respective operator. The increment or decrement operation occurs *after* the operand is evaluated. This issue arises only when the postfix increment or decrement operation occurs in the context of a larger expression.
3333

3434
When a postfix operator is applied to a function argument, the value of the argument is not guaranteed to be incremented or decremented before it is passed to the function. See section 1.9.17 in the C++ standard for more information.
3535

3636
Applying the postfix increment operator to a pointer to an array of objects of type **long** actually adds four to the internal representation of the pointer. This behavior causes the pointer, which previously referred to the *n*th element of the array, to refer to the (*n*+1)th element.
3737

3838
The operands to postfix increment and postfix decrement operators must be modifiable (not **const**) l-values of arithmetic or pointer type. The type of the result is the same as that of the *postfix-expression*, but it is no longer an l-value.
3939

40-
**Visual Studio 2017 version 15.3 and later** (available with [/std:c++17](../build/reference/std-specify-language-standard-version.md)): The operand of a postfix increment or decrement operator may not be of type `bool`.
40+
**Visual Studio 2017 version 15.3 and later** (available with [/std:c++17](../build/reference/std-specify-language-standard-version.md)): The operand of a postfix increment or decrement operator may not be of type **bool**.
4141

4242
The following code illustrates the postfix increment operator:
4343

docs/cpp/private-cpp.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ private base-class
2222
```
2323

2424
## Remarks
25-
When preceding a list of class members, the `private` keyword specifies that those members are accessible only from member functions and friends of the class. This applies to all members declared up to the next access specifier or the end of the class.
25+
When preceding a list of class members, the **private** keyword specifies that those members are accessible only from member functions and friends of the class. This applies to all members declared up to the next access specifier or the end of the class.
2626

27-
When preceding the name of a base class, the `private` keyword specifies that the public and protected members of the base class are private members of the derived class.
27+
When preceding the name of a base class, the **private** keyword specifies that the public and protected members of the base class are private members of the derived class.
2828

2929
Default access of members in a class is private. Default access of members in a structure or union is public.
3030

@@ -33,7 +33,7 @@ private base-class
3333
For related information, see [friend](../cpp/friend-cpp.md), [public](../cpp/public-cpp.md), [protected](../cpp/protected-cpp.md), and the member-access table in [Controlling Access to Class Members](member-access-control-cpp.md).
3434

3535
## /clr Specific
36-
In CLR types, the C++ access specifier keywords (**public**, `private`, and `protected`) can affect the visibility of types and methods with regard to assemblies. For more information, see [Member Access Control](member-access-control-cpp.md).
36+
In CLR types, the C++ access specifier keywords (**public**, **private**, and **protected**) can affect the visibility of types and methods with regard to assemblies. For more information, see [Member Access Control](member-access-control-cpp.md).
3737

3838
> [!NOTE]
3939
> Files compiled with [/LN](../build/reference/ln-create-msil-module.md) are not affected by this behavior. In this case, all managed classes (either public or private) will be visible.

docs/cpp/program-termination.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ In C++, there are several ways to exit a program:
1818

1919
- Call the [abort](../cpp/abort-function.md) function.
2020

21-
- Execute a [return](../cpp/return-statement-in-program-termination-cpp.md) statement from **main**.
21+
- Execute a [return](../cpp/return-statement-in-program-termination-cpp.md) statement from `main`.
2222

2323
## See Also
2424
[main: Program Startup](../cpp/main-program-startup.md)

docs/cpp/protected-cpp.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected base-class
2222
```
2323

2424
## Remarks
25-
The `protected` keyword specifies access to class members in the *member-list* up to the next access specifier (**public** or `private`) or the end of the class definition. Class members declared as `protected` can be used only by the following:
25+
The **protected** keyword specifies access to class members in the *member-list* up to the next access specifier (**public** or **private**) or the end of the class definition. Class members declared as **protected** can be used only by the following:
2626

2727
- Member functions of the class that originally declared these members.
2828

@@ -32,16 +32,16 @@ protected base-class
3232

3333
- Direct privately derived classes that also have private access to protected members.
3434

35-
When preceding the name of a base class, the `protected` keyword specifies that the public and protected members of the base class are protected members of its derived classes.
35+
When preceding the name of a base class, the **protected** keyword specifies that the public and protected members of the base class are protected members of its derived classes.
3636

37-
Protected members are not as private as `private` members, which are accessible only to members of the class in which they are declared, but they are not as public as **public** members, which are accessible in any function.
37+
Protected members are not as private as **private** members, which are accessible only to members of the class in which they are declared, but they are not as public as **public** members, which are accessible in any function.
3838

3939
Protected members that are also declared as **static** are accessible to any friend or member function of a derived class. Protected members that are not declared as **static** are accessible to friends and member functions in a derived class only through a pointer to, reference to, or object of the derived class.
4040

4141
For related information, see [friend](../cpp/friend-cpp.md), [public](../cpp/public-cpp.md), [private](../cpp/private-cpp.md), and the member-access table in [Controlling Access to Class Members](member-access-control-cpp.md).
4242

4343
## /clr Specific
44-
In CLR types, the C++ access specifier keywords (**public**, `private`, and `protected`) can affect the visibility of types and methods with regard to assemblies. For more information, see [Member Access Control](member-access-control-cpp.md).
44+
In CLR types, the C++ access specifier keywords (**public**, **private**, and **protected**) can affect the visibility of types and methods with regard to assemblies. For more information, see [Member Access Control](member-access-control-cpp.md).
4545

4646
> [!NOTE]
4747
> Files compiled with [/LN](../build/reference/ln-create-msil-module.md) are not affected by this behavior. In this case, all managed classes (either public or private) will be visible.

docs/cpp/ptr32-ptr64.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.workload: ["cplusplus"]
1616

1717
**Microsoft Specific**
1818

19-
`__ptr32` represents a native pointer on a 32-bit system, while `__ptr64` represents a native pointer on a 64-bit system.
19+
**__ptr32** represents a native pointer on a 32-bit system, while **__ptr64** represents a native pointer on a 64-bit system.
2020

2121
The following example shows how to declare each of these pointer types:
2222

@@ -25,14 +25,14 @@ int * __ptr32 p32;
2525
int * __ptr64 p64;
2626
```
2727

28-
On a 32-bit system, a pointer declared with `__ptr64` is truncated to a 32-bit pointer. On a 64-bit system, a pointer declared with `__ptr32` is coerced to a 64-bit pointer.
28+
On a 32-bit system, a pointer declared with **__ptr64** is truncated to a 32-bit pointer. On a 64-bit system, a pointer declared with **__ptr32** is coerced to a 64-bit pointer.
2929

3030
> [!NOTE]
31-
> You cannot use `__ptr32` or `__ptr64` when compiling with **/clr:pure**. Otherwise, Compiler Error C2472 will be generated. The **/clr:pure** and **/clr:safe** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
31+
> You cannot use **__ptr32** or **__ptr64** when compiling with **/clr:pure**. Otherwise, Compiler Error C2472 will be generated. The **/clr:pure** and **/clr:safe** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
3232
3333
## Example
3434

35-
The following example shows how to declare and allocate pointers with the `__ptr32` and `__ptr64` keywords.
35+
The following example shows how to declare and allocate pointers with the **__ptr32** and **__ptr64** keywords.
3636

3737
```cpp
3838
#include <cstdlib>

docs/cpp/public-cpp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public base-class
3333
For more information, see [private](../cpp/private-cpp.md), [protected](../cpp/protected-cpp.md), [friend](../cpp/friend-cpp.md), and the member-access table in [Controlling Access to Class Members](member-access-control-cpp.md).
3434

3535
## /clr Specific
36-
In CLR types, the C++ access specifier keywords (**public**, `private`, and `protected`) can affect the visibility of types and methods with regard to assemblies. For more information, see [Member Access Control](member-access-control-cpp.md).
36+
In CLR types, the C++ access specifier keywords (**public**, **private**, and **protected**) can affect the visibility of types and methods with regard to assemblies. For more information, see [Member Access Control](member-access-control-cpp.md).
3737

3838
> [!NOTE]
3939
> Files compiled with [/LN](../build/reference/ln-create-msil-module.md) are not affected by this behavior. In this case, all managed classes (either public or private) will be visible.

docs/cpp/raise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ __raise method-declarator;
2626
## Remarks
2727
From managed code, an event can only be raised from within the class where it is defined. See [event](../windows/event-cpp-component-extensions.md) for more information.
2828

29-
The keyword `__raise` causes an error to be emitted if you call a non-event.
29+
The keyword **__raise** causes an error to be emitted if you call a non-event.
3030

3131
> [!NOTE]
3232
> A templated class or struct cannot contain events.

docs/cpp/raising-software-exceptions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Some of the most common sources of program errors are not flagged as exceptions
2020

2121
- Define your own exception code for the event.
2222

23-
- Call **RaiseException** when you detect a problem.
23+
- Call `RaiseException` when you detect a problem.
2424

2525
- Use exception-handling filters to test for the exception code you defined.
2626

docs/cpp/range-based-for-statement-cpp.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ for ( for-range-declaration : expression )
2222
```
2323

2424
## Remarks
25-
Use the range-based `for` statement to construct loops that must execute through a "range", which is defined as anything that you can iterate through—for example, `std::vector`, or any other C++ Standard Library sequence whose range is defined by a `begin()` and `end()`. The name that is declared in the `for-range-declaration` portion is local to the `for` statement and cannot be re-declared in `expression` or `statement`. Note that the [auto](../cpp/auto-cpp.md) keyword is preferred in the `for-range-declaration` portion of the statement.
25+
Use the range-based **for** statement to construct loops that must execute through a "range", which is defined as anything that you can iterate through—for example, `std::vector`, or any other C++ Standard Library sequence whose range is defined by a `begin()` and `end()`. The name that is declared in the `for-range-declaration` portion is local to the **for** statement and cannot be re-declared in `expression` or `statement`. Note that the [auto](../cpp/auto-cpp.md) keyword is preferred in the `for-range-declaration` portion of the statement.
2626

2727
**New in Visual Studio 2017:** Range-based for loops no longer require that begin() and end() return objects of the same type. This enables end() to return a sentinel object such as used by ranges as defined in the Ranges-V3 proposal. For more information, see [Generalizing the Range-Based For Loop](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0184r0.html) and the [range-v3 library on GitHub](https://github.com/ericniebler/range-v3).
2828

29-
This code shows how to use range-based `for` loops to iterate through an array and a vector:
29+
This code shows how to use range-based **for** loops to iterate through an array and a vector:
3030

3131
```cpp
3232
// range-based-for.cpp
@@ -102,9 +102,9 @@ int main()
102102
`end of vector test`
103103
```
104104

105-
A range-based `for` loop terminates when one of these in `statement` is executed: a [break](../cpp/break-statement-cpp.md), [return](../cpp/return-statement-cpp.md), or [goto](../cpp/goto-statement-cpp.md) to a labeled statement outside the range-based **for** loop. A [continue](../cpp/continue-statement-cpp.md) statement in a range-based `for` loop terminates only the current iteration.
105+
A range-based **for** loop terminates when one of these in `statement` is executed: a [break](../cpp/break-statement-cpp.md), [return](../cpp/return-statement-cpp.md), or [goto](../cpp/goto-statement-cpp.md) to a labeled statement outside the range-based **for** loop. A [continue](../cpp/continue-statement-cpp.md) statement in a range-based **for** loop terminates only the current iteration.
106106

107-
Keep in mind these facts about range-based `for`:
107+
Keep in mind these facts about range-based **for**:
108108

109109
- Automatically recognizes arrays.
110110

docs/cpp/reference-type-function-returns.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ y = 9
8282

8383
Declarations of reference types must contain initializers except in the following cases:
8484

85-
- Explicit `extern` declaration
85+
- Explicit **extern** declaration
8686

8787
- Declaration of a class member
8888

docs/cpp/references-cpp.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ A reference, like a pointer, stores the address of an object that is located els
3434

3535
- An optional storage class specifier.
3636

37-
- Optional **const** and/or `volatile` qualifiers.
37+
- Optional **const** and/or **volatile** qualifiers.
3838

3939
- The type specifier: the name of a type.
4040

@@ -44,7 +44,7 @@ A reference, like a pointer, stores the address of an object that is located els
4444

4545
- The & operator or && operator.
4646

47-
- Optional **const** and/or `volatile` qualifers.
47+
- Optional **const** and/or **volatile** qualifers.
4848

4949
- The identifier.
5050

docs/cpp/reinterpret-cast-operator.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ reinterpret_cast < type-id > ( expression )
2222
```
2323

2424
## Remarks
25-
Misuse of the `reinterpret_cast` operator can easily be unsafe. Unless the desired conversion is inherently low-level, you should use one of the other cast operators.
25+
Misuse of the **reinterpret_cast** operator can easily be unsafe. Unless the desired conversion is inherently low-level, you should use one of the other cast operators.
2626

27-
The `reinterpret_cast` operator can be used for conversions such as `char*` to `int*`, or `One_class*` to `Unrelated_class*`, which are inherently unsafe.
27+
The **reinterpret_cast** operator can be used for conversions such as `char*` to `int*`, or `One_class*` to `Unrelated_class*`, which are inherently unsafe.
2828

29-
The result of a `reinterpret_cast` cannot safely be used for anything other than being cast back to its original type. Other uses are, at best, nonportable.
29+
The result of a **reinterpret_cast** cannot safely be used for anything other than being cast back to its original type. Other uses are, at best, nonportable.
3030

31-
The `reinterpret_cast` operator cannot cast away the **const**, `volatile`, or **__unaligned** attributes. See [const_cast Operator](../cpp/const-cast-operator.md) for information on removing these attributes.
31+
The **reinterpret_cast** operator cannot cast away the **const**, **volatile**, or **__unaligned** attributes. See [const_cast Operator](../cpp/const-cast-operator.md) for information on removing these attributes.
3232

33-
The `reinterpret_cast` operator converts a null pointer value to the null pointer value of the destination type.
33+
The **reinterpret_cast** operator converts a null pointer value to the null pointer value of the destination type.
3434

35-
One practical use of `reinterpret_cast` is in a hash function, which maps a value to an index in such a way that two distinct values rarely end up with the same index.
35+
One practical use of **reinterpret_cast** is in a hash function, which maps a value to an index in such a way that two distinct values rarely end up with the same index.
3636

3737
```cpp
3838
#include <iostream>
@@ -74,7 +74,7 @@ Output:
7474
64829
7575
```
7676
77-
The `reinterpret_cast` allows the pointer to be treated as an integral type. The result is then bit-shifted and XORed with itself to produce a unique index (unique to a high degree of probability). The index is then truncated by a standard C-style cast to the return type of the function.
77+
The **reinterpret_cast** allows the pointer to be treated as an integral type. The result is then bit-shifted and XORed with itself to produce a unique index (unique to a high degree of probability). The index is then truncated by a standard C-style cast to the return type of the function.
7878
7979
## See Also
8080
[Casting Operators](../cpp/casting-operators.md)

docs/cpp/relational-function-templates.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ template<typename _Interface,
7878
*i*
7979
A raw interface pointer.
8080

81-
`p`
81+
*p*
8282
A smart pointer.
8383

8484
## Remarks

docs/cpp/relational-operators-equal-and-equal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ expression >= expression
3333

3434
- Greater than or equal to (**>=**)
3535

36-
The relational operators have left-to-right associativity. Both operands of relational operators must be of arithmetic or pointer type. They yield values of type `bool`. The value returned is **false** (0) if the relationship in the expression is false; otherwise, the value returned is **true** (1).
36+
The relational operators have left-to-right associativity. Both operands of relational operators must be of arithmetic or pointer type. They yield values of type **bool**. The value returned is FALSE (0) if the relationship in the expression is false; otherwise, the value returned is TRUE (1).
3737

3838
## Example
3939

0 commit comments

Comments
 (0)