转载自 https://blog.csdn.net/xuchen_wang/article/details/92830263
记录一下,以免忘记
泛型的类型参数:
where T : struct 类型参数需是值类型
where T: class 类型参数需是引用类型
where T: new() 类型参数要有一个public无参构造函数
where T: 类型参数要派生自某个基类
where T: 类型参数要实现某个接口
where T: U T和U都是类型参数,T必须是或者派生自U