Bool
bool
is Move's primitive type for boolean true
and false
values.
#
LiteralsLiterals for bool
are either true
or false
.
#
Operations#
Logicalbool
supports three logical operations:
Syntax | Description | Equivalent Expression |
---|---|---|
&& | short-circuiting logical and | p && q is equivalent to if (p) q else false |
| | short-circuiting logical or | p <code>|</code> q is equivalent to if (p) true else q |
! | logical negation | !p is equivalent to if (p) false else true |
#
Control Flowbool
values are used in several of Move's control-flow constructs: