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

38 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[expr.log.and]
# 7 Expressions [[expr]](./#expr)
## 7.6 Compound expressions [[expr.compound]](expr.compound#expr.log.and)
### 7.6.14 Logical AND operator [expr.log.and]
[logical-and-expression:](#nt:logical-and-expression "7.6.14Logical AND operator[expr.log.and]")
[*inclusive-or-expression*](expr.or#nt:inclusive-or-expression "7.6.13Bitwise inclusive OR operator[expr.or]")
[*logical-and-expression*](#nt:logical-and-expression "7.6.14Logical AND operator[expr.log.and]") && [*inclusive-or-expression*](expr.or#nt:inclusive-or-expression "7.6.13Bitwise inclusive OR operator[expr.or]")
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L7744)
The && operator groups left-to-right[.](#1.sentence-1)
The operands are both
contextually converted to bool ([[conv]](conv "7.3Standard conversions"))[.](#1.sentence-2)
The
result is true if both operands are true andfalse otherwise[.](#1.sentence-3)
Unlike &, && guarantees
left-to-right evaluation: the second operand is not evaluated if the
first operand is false[.](#1.sentence-4)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L7753)
The result is a bool[.](#2.sentence-1)
If the second expression is evaluated,
the first expression is sequenced before
the second expression ([[intro.execution]](intro.execution "6.10.1Sequential execution"))[.](#2.sentence-2)