C# where(泛型类型约束)

/*在泛型类型定义中,where 子句用于指定对下列类型的约束:这些类型可用作泛型声明中定义的类型参数的实参。 
 例如,可以声明一个泛型类 MyGenericClass,这样,类型参数 T 就可以实现 IComparable<T> 接口:
*/ public class MyGenericClass<T> where T:IComparable { }
原文地址:https://www.cnblogs.com/fumj/p/3445714.html