Skip to content

Commit 9509f70

Browse files
author
Michael Blome
committed
bool for increment decrement operators removed
1 parent 8926252 commit 9509f70

2 files changed

Lines changed: 3 additions & 1 deletion

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ i++;
6767

6868
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.
6969

70-
The operand of a postfix increment operator may also be of type `bool`, in which case the operand is evaluated and then set to **true**. The operand of a postfix decrement operator cannot be of type `bool`.
70+
**Visual Studio 2017 version 15.3 and later:**(available with [/std:c++latest](../build/reference/std-specify-language-standard-version.md)) The operand of a postfix increment or decrement operator may not be of type `bool`.
7171

7272
The following code illustrates the postfix increment operator:
7373

‎docs/cpp/prefix-increment-and-decrement-operators-increment-and-decrement.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ translation.priority.ht:
5353
The prefix increment operator (`++`) adds one to its operand; this incremented value is the result of the expression. The operand must be an l-value not of type **const**. The result is an l-value of the same type as the operand.
5454

5555
The prefix decrement operator (**--**) is analogous to the prefix increment operator, except that the operand is decremented by one and the result is this decremented value.
56+
57+
**Visual Studio 2017 version 15.3 and later:**(available with [/std:c++latest](../build/reference/std-specify-language-standard-version.md)) The operand of an increment or decrement operator may not be of type `bool`.
5658

5759
Both the prefix and postfix increment and decrement operators affect their operands. The key difference between them is the order in which the increment or decrement takes place in the evaluation of an expression. (For more information, see [Postfix Increment and Decrement Operators](../cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md).) In the prefix form, the increment or decrement takes place before the value is used in expression evaluation, so the value of the expression is different from the value of the operand. In the postfix form, the increment or decrement takes place after the value is used in expression evaluation, so the value of the expression is the same as the value of the operand. For example, the following program prints "`++i = 6`":
5860

0 commit comments

Comments
 (0)