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.
可能重复: Java 运算符:|= bitwise OR and assign示例
|= bitwise OR and assign
boolean bAlive; bAlive |= this.properties.containsKey(name);
在上面,代码使用'|'. 为什么使用'|' ?
'|'
'|
提前致谢。
布尔值与右侧的值进行或运算。
如果this.properties.containsKey(name)是TRUE,则bAlive设置为TRUE。
this.properties.containsKey(name)
TRUE
bAlive
否则,bAlive保持不变。
我有一个自定义类型 A 的对象(一个具有许多成员的类,这些成员是 std::string、向量等,但没有原始指针)。
现在,我有一个 A 对象列表。
A tmpobj; std::list<A> temp;
如果我想调用 std::list::remove 函数从我正在尝试的列表中删除特定对象