Files
cppdraft_translate/cppdraft/expr/or.md
2025-10-25 03:02:53 +03:00

1.4 KiB

[expr.or]

7 Expressions [expr]

7.6 Compound expressions [expr.compound]

7.6.13 Bitwise inclusive OR operator [expr.or]

inclusive-or-expression:
exclusive-or-expression
inclusive-or-expression | exclusive-or-expression

1

#

The | operator groups left-to-right.

The operands shall be of integral or unscoped enumeration type.

The usual arithmetic conversions ([expr.arith.conv]) are performed.

Given the coefficients xi and yi of the base-2 representation ([basic.fundamental]) of the converted operands x and y, the coefficient ri of the base-2 representation of the result r is 1 if at least one of xi and yi is 1, and 0 otherwise.

[Note 1:

The result is the bitwise inclusive or function of the operands.

— end note]