1.4 KiB
1.4 KiB
[expr.xor]
7 Expressions [expr]
7.6 Compound expressions [expr.compound]
7.6.12 Bitwise exclusive OR operator [expr.xor]
exclusive-or-expression:
and-expression
exclusive-or-expression ^ and-expression
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 either (but not both) of xi and yi is 1, and 0 otherwise.
[Note 1:
The result is the bitwise exclusive or function of the operands.
â end note]