Bool
bool is Move’s primitive type for boolean true and false values.
Literals
Section titled “Literals”Literals for bool are either true or false.
Operations
Section titled “Operations”Logical
Section titled “Logical”bool supports three logical operations:
| Syntax | Description | Equivalent Expression | 
|---|---|---|
| && | short-circuiting logical and | p && qis equivalent toif (p) q else false | 
| || | short-circuiting logical or | p || qis equivalent toif (p) true else q | 
| ! | logical negation | !pis equivalent toif (p) false else true | 
Control Flow
Section titled “Control Flow”bool values are used in several of Move’s control-flow constructs:
Ownership
Section titled “Ownership”As with the other scalar values built into the language, boolean values are implicitly copyable,
meaning they can be copied without an explicit instruction such as
copy.