例如,如果您知道您的泛型类仅用于引用类型,则应用类约束。
For example, if you know that your generic class is intended for use only with reference types, apply the class constraint.
在将某一约束应用于泛型类型参数时,必须存在从具体参数到该约束类型的隐式标识或引用转换。
When a constraint is applied to a generic type parameter, an implicit identity or reference conversion must exist from the concrete argument to the type of the constraint.
通过某个可选参数声明了过程,该参数使用未约束为引用类型的类型参数。
A procedure is declared with an optional parameter that USES a type parameter that is not constrained to be a reference type.
应用推荐