Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个开源项目的代码,想知道这个运算符是什么意思。这个运算符是什么 |= ?在以下代码中使用:
uint32_t a = VALUE1 | VALUE2; a |= VALUE1;
任何想法 ?
|=不是 GCC 特定的运算符 - 它是标准的 C++ 复合赋值运算符。a |= b大致等价于a = a | b,其中|是位或运算符;除了|=具有=(非常低优先级)的优先级。
|=
a |= b
a = a | b
|
=