摘要:
Eg: class Awhere T:new()where表明了对类型变量T的约束关系。where T: A表示类型变量是继承于A的,或者是A本身。where T:new()指明了创建T的实例时应该使用的构造函数。.NET支持的类型参数约束有以下五种:where T : struct | T必须是一... 阅读全文
posted @ 2016-01-11 12:08 barrytsai 阅读(693) 评论(0) 推荐(0)
|
|
|
|
摘要:
Eg: class Awhere T:new()where表明了对类型变量T的约束关系。where T: A表示类型变量是继承于A的,或者是A本身。where T:new()指明了创建T的实例时应该使用的构造函数。.NET支持的类型参数约束有以下五种:where T : struct | T必须是一... 阅读全文
posted @ 2016-01-11 12:08 barrytsai 阅读(693) 评论(0) 推荐(0) |
|