The predefined boolean equality operators are:
bool operator ==(bool x, bool y);
bool operator !=(bool x, bool y);
The result of == is true if both x and y are true or if both x and y are
false. Otherwise, the result is
false.
C# LANGUAGE SPECIFICATION
166
The result of != is false if both x and y are true or if both x and y are
false. Otherwise, the result is
true. When the operands are of type bool, the != operator produces the same
result as the ^ operator.
bool operator ==(bool x, bool y);
bool operator !=(bool x, bool y);
The result of == is true if both x and y are true or if both x and y are
false. Otherwise, the result is
false.
C# LANGUAGE SPECIFICATION
166
The result of != is false if both x and y are true or if both x and y are
false. Otherwise, the result is
true. When the operands are of type bool, the != operator produces the same
result as the ^ operator.
本文介绍了预定义布尔等式运算符==和!=的操作规则。当两个操作数相同时,==返回真;反之则返回假。而!=运算符在两个操作数不同时返回真,相同则返回假。对于布尔类型的操作数,!=与异或运算符^效果一致。
1109

被折叠的 条评论
为什么被折叠?



