Relational and type-testing operators
The ==,!=, <, >, <=, >=, is and as operators are called the relational and type-testing operators. relational-expression: equality-expression: The is operator is described in §7.10.10 and the as operator is described in §7.10.11. The ==,!=, <, >, <= and >= operators are comparison operators. If an operand of a comparison operator has the compile-time type dynamic, then the expression is dynamically bound (§7.2.2). In this case the compile-time type of the expression is dynamic, and the resolution described below will take place at run-time using the run-time type of those operands that have the compile-time type dynamic. For an operation of the form x op y, where op is a comparison operator, overload resolution (§7.3.4) is applied to select a specific operator implementation. The operands are converted to the parameter types of the selected operator, and the type of the result is the return type of the operator. The predefined comparison operators are described in the following sections. All predefined comparison operators return a result of type bool, as described in the following table.
|