Tag: 通用约束

什么是“特级”?

没有得到如下所示的东西来编译: public class Gen<T> where T : System.Array { } 与错误 约束不能是特殊的类“System.Array” 我开始怀疑,什么是 “特殊class”? 当他们在通用约束中指定System.Enum时,人们似乎经常会遇到同样的错误。 我也得到了与System.Object , System.Delegate , System.MulticastDelegate和System.ValueType相同的结果。 他们有更多吗? 我在C#中找不到“特殊类”的任何信息。 另外,这些类别有什么特别之处,我们不能将它们用作generics约束?