挑战: 请创建以下类的实例(使用任何类型为T):
class Foo<T>
where T : Foo<T>
{
}
Run Code Online (Sandbox Code Playgroud)
你可以使用任何你喜欢的技术; 简单的"新MyClass ......",使用反射,黑客攻击MSIL,等等.
Mar*_*ell 12
static class Program {
static void Main() {
Foo<Bar> foo = new Foo<Bar>();
}
}
class Foo<T> where T : Foo<T> {}
class Bar : Foo<Bar> {}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2246 次 |
| 最近记录: |