码迷,mamicode.com
首页 > Windows程序 > 详细

C# 泛型多种参数类型与多重约束 示例

时间:2017-07-17 00:31:29      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:border   line   body   div   number   arp   log   plain   bsp   

C# 泛型多种参数类型与多重约束 示例

1
2
3
4
5
6
7
8
9
10
11
12
interface IMyInterface
{
}
 
class Dictionary<TKey, TVal>
    where TKey : IComparable, IEnumerable
    where TVal : IMyInterface
{
    public void Add(TKey key, TVal val)
    {
    }
}

C# 泛型多种参数类型与多重约束 示例

标签:border   line   body   div   number   arp   log   plain   bsp   

原文地址:http://www.cnblogs.com/sanyejun/p/7192382.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!