14.9.4 Boolean equality operators

来源:互联网 发布:互联网商业模式知乎 编辑:程序博客网 时间:2024/06/04 19:22
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.