7.7.3 Logical Negation Operator
For an operation of the form !x
, unary operator overload resolution (§7.3.3) is applied to select a specific operator implementation. The operand is converted to the parameter type of the selected operator, and the type of the result is the return type of the operator. Only one predefined logical negation operator exists:
bool operator !(bool x);
This operator computes the logical negation of the operand: If the operand is true
, the result is false
. If the operand is false
, the result is true
.
7.7.4 Bitwise Complement Operator
For an operation of the form ~x
, unary operator overload resolution (§7.3.3) is applied to select a specific operator implementation. The operand is converted to the parameter type of the ...
Get The C# Programming Language (Covering C# 4.0), Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.