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
Copy file name to clipboardExpand all lines: docs/cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,15 @@ i++;
29
29
30
30
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.
31
31
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.
33
33
34
34
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.
35
35
36
36
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.
37
37
38
38
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.
39
39
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**.
41
41
42
42
The following code illustrates the postfix increment operator:
Copy file name to clipboardExpand all lines: docs/cpp/private-cpp.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,9 @@ private base-class
22
22
```
23
23
24
24
## 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.
26
26
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.
28
28
29
29
Default access of members in a class is private. Default access of members in a structure or union is public.
30
30
@@ -33,7 +33,7 @@ private base-class
33
33
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).
34
34
35
35
## /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).
37
37
38
38
> [!NOTE]
39
39
> 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.
Copy file name to clipboardExpand all lines: docs/cpp/protected-cpp.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ protected base-class
22
22
```
23
23
24
24
## 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:
26
26
27
27
- Member functions of the class that originally declared these members.
28
28
@@ -32,16 +32,16 @@ protected base-class
32
32
33
33
- Direct privately derived classes that also have private access to protected members.
34
34
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.
36
36
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.
38
38
39
39
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.
40
40
41
41
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).
42
42
43
43
## /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).
45
45
46
46
> [!NOTE]
47
47
> 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.
Copy file name to clipboardExpand all lines: docs/cpp/ptr32-ptr64.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ ms.workload: ["cplusplus"]
16
16
17
17
**Microsoft Specific**
18
18
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.
20
20
21
21
The following example shows how to declare each of these pointer types:
22
22
@@ -25,14 +25,14 @@ int * __ptr32 p32;
25
25
int * __ptr64 p64;
26
26
```
27
27
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.
29
29
30
30
> [!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.
32
32
33
33
## Example
34
34
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.
Copy file name to clipboardExpand all lines: docs/cpp/public-cpp.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ public base-class
33
33
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).
34
34
35
35
## /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).
37
37
38
38
> [!NOTE]
39
39
> 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.
Copy file name to clipboardExpand all lines: docs/cpp/raise.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ __raise method-declarator;
26
26
## Remarks
27
27
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.
28
28
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.
30
30
31
31
> [!NOTE]
32
32
> A templated class or struct cannot contain events.
Copy file name to clipboardExpand all lines: docs/cpp/range-based-for-statement-cpp.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@ for ( for-range-declaration : expression )
22
22
```
23
23
24
24
## 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.
26
26
27
27
**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).
28
28
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:
30
30
31
31
```cpp
32
32
// range-based-for.cpp
@@ -102,9 +102,9 @@ int main()
102
102
`end of vector test`
103
103
```
104
104
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.
106
106
107
-
Keep in mind these facts about range-based `for`:
107
+
Keep in mind these facts about range-based **for**:
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.
26
26
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.
28
28
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.
30
30
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.
32
32
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.
34
34
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.
36
36
37
37
```cpp
38
38
#include<iostream>
@@ -74,7 +74,7 @@ Output:
74
74
64829
75
75
```
76
76
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.
Copy file name to clipboardExpand all lines: docs/cpp/relational-operators-equal-and-equal.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ expression >= expression
33
33
34
34
- Greater than or equal to (**>=**)
35
35
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).
0 commit comments