110,539
社区成员
发帖
与我相关
我的任务
分享
class A<T>
{
public static A<T> Create<T>()
{
if (typeof(T) is int) return new A_int();
if (typeof(T) is string) return new A_string();
else return new A<T>();
}
}
class A_int : A<int> { }
class A_string : A<string> { }