泛型多种参数类型与多重约束

泛型多种参数类型与多重约束

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

interface IMyInterface
{
} class Dictionary<TKey, TVal>
where TKey : IComparable, IEnumerable
where TVal : IMyInterface
{
public void Add(TKey key, TVal val)
{
}
}

  

05-11 18:06