Files
2025-10-25 03:02:53 +03:00

1.5 KiB

[expr.log.and]

7 Expressions [expr]

7.6 Compound expressions [expr.compound]

7.6.14 Logical AND operator [expr.log.and]

logical-and-expression:
inclusive-or-expression
logical-and-expression && inclusive-or-expression

1

#

The && operator groups left-to-right.

The operands are both contextually converted to bool ([conv]).

The result is true if both operands are true andfalse otherwise.

Unlike &, && guarantees left-to-right evaluation: the second operand is not evaluated if the first operand is false.

2

#

The result is a bool.

If the second expression is evaluated, the first expression is sequenced before the second expression ([intro.execution]).