Skip to content

Commit 2c5d40b

Browse files
author
Colin Robertson
authored
Update bool-cpp.md
Keywords are bold.
1 parent c015fcc commit 2c5d40b

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

docs/cpp/bool-cpp.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ manager: "ghogen"
1818
ms.workload: ["cplusplus"]
1919
---
2020
# bool (C++)
21+
2122
This keyword is a built-in type. A variable of this type can have values [true](../cpp/true-cpp.md) and [false](../cpp/false-cpp.md). Conditional expressions have the type `bool` and so have values of type `bool`. For example, `i!=0` now has **true** or **false** depending on the value of `i`.
2223

23-
**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 or prefix increment or decrement operator may not be of type `bool`. In other words, given a variable **b** of type **bool**, these expressions are no longer allowed:
24+
**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 or prefix increment or decrement operator may not be of type **bool**. In other words, given a variable **b** of type **bool**, these expressions are no longer allowed:
2425

2526
```cpp
2627
b++;
@@ -29,28 +30,29 @@ This keyword is a built-in type. A variable of this type can have values [true](
2930
--b;
3031
```
3132

32-
The values **true** and **false** have the following relationship:
33+
The values **true** and **false** have the following relationship:
3334

34-
```
35+
```cpp
3536
!false == true
3637
!true == false
3738
```
3839

39-
In the following statement:
40+
In the following statement:
4041

41-
```
42+
```cpp
4243
if (condexpr1) statement1;
4344
```
4445

45-
If `condexpr1` is **true**, `statement1` is always executed; if `condexpr1` is **false**, `statement1` is never executed.
46+
If `condexpr1` is **true**, `statement1` is always executed; if `condexpr1` is **false**, `statement1` is never executed.
4647

47-
When a postfix or prefix `++` operator is applied to a variable of type `bool`, the variable is set to **true**.
48-
**Visual Studio 2017 version 15.3 and later**: operator++ for bool was removed from the language and is no longer supported.
48+
When a postfix or prefix **++** operator is applied to a variable of type **bool**, the variable is set to **true**.
49+
**Visual Studio 2017 version 15.3 and later**: operator++ for **bool** was removed from the language and is no longer supported.
4950

50-
The postfix or prefix `--` operator cannot be applied to a variable of this type.
51+
The postfix or prefix **--** operator cannot be applied to a variable of this type.
5152

52-
The `bool` type participates in integral promotions. An r-value of type `bool` can be converted to an r-value of type `int`, with **false** becoming zero and **true** becoming one. As a distinct type, `bool` participates in overload resolution.
53+
The **bool** type participates in integral promotions. An r-value of type **bool** can be converted to an r-value of type **int**, with **false** becoming zero and **true** becoming one. As a distinct type, **bool** participates in overload resolution.
5354

54-
## See Also
55-
[Keywords](../cpp/keywords-cpp.md)
56-
[Fundamental Types](../cpp/fundamental-types-cpp.md)
55+
## See also
56+
57+
[Keywords](../cpp/keywords-cpp.md)<br/>
58+
[Fundamental Types](../cpp/fundamental-types-cpp.md)<br/>

0 commit comments

Comments
 (0)