泛型参数约束

where T : class,     T必 须是引用类型参数

where T : Struct,     T必须是值类型

where T : Interface,     T必须指定的Interface接口或者实现了该接口的接口

where T : BaseClass,     T必须继承基类或者是其本身 

where T : New(),     T必须有无参构造函数  有多个约束的时候置于末尾

posted @ 2012-09-26 12:33  |丶Edmond  阅读(129)  评论(0编辑  收藏  举报