C# 语言类型参数(类)
示例
声明:
class MyGenericClass<T1, T2, T3, ...> { //使用类型参数做一些事情。 }
初始化:
var x = new MyGenericClass<int, char, bool>();
用法(作为参数的类型):
void AnotherMethod(MyGenericClass<float, byte, char> arg) { ... }
声明:
class MyGenericClass<T1, T2, T3, ...> { //使用类型参数做一些事情。 }
初始化:
var x = new MyGenericClass<int, char, bool>();
用法(作为参数的类型):
void AnotherMethod(MyGenericClass<float, byte, char> arg) { ... }