Challenge: Please create an instance of the following class (using any type as T):
class Foo<T>
where T : Foo<T>
{
}
You may use any technique you like; plain "new MyClass...", using reflection, hacking MSIL, whatever.
Challenge: Please create an instance of the following class (using any type as T):
class Foo<T>
where T : Foo<T>
{
}
You may use any technique you like; plain "new MyClass...", using reflection, hacking MSIL, whatever.
static class Program {
static void Main() {
Foo<Bar> foo = new Foo<Bar>();
}
}
class Foo<T> where T : Foo<T> {}
class Bar : Foo<Bar> {}