Operator '==' can't be applied to type T?
问题 I thought this method was valid but I was wrong: static void Equals<T>(T x, T y) { return x == y; //operator == can't be applied to type T } After reading the specifiation (§7.2.4 in v3.0 and §7.3.4 in v4.0): 7.2.4 Binary operator overload resolution An operation of the form x op y, where op is an overloadable binary operator, x is an expression of type X, and y is an expression of type Y, is processed as follows: The set of candidate user-defined operators provided by X and Y for the