От: | Аноним | ||
Дата: | 21.09.06 06:06 | ||
Оценка: |
public class Generic<T> where T : new() { }
public abstract class Foo
{
public Foo() { }
}
public class Program
{
public static void Main()
{
// error CS0310: The type 'Foo' must have a public parameterless constructor
// in order to use it as parameter 'T' in the generic type or method 'Generic<T>'
new Generic<Foo>();
}
}