Reputation: 2345
I have this code from an open source project, and was wondering what does this operator mean. what is this operator |= ? used in the following code:
uint32_t a = VALUE1 | VALUE2;
a |= VALUE1;
any idea ?
Upvotes: 0
Views: 84
Reputation: 4708
|=
is not a GCC-specific operator - it is a standard C++ compound assignment operator. a |= b
is roughly equivalent to a = a | b
, where |
is the bitwise-OR operator; except that |=
has the precedence of =
(very low precedence).
Upvotes: 2