I know you can write:
class GenericClass<T> where T : new()
{
}
to enforce that T has an empty constructor.
My Qs are :
can you enforce that
Thas a constructor with a specific type of parameter? Like:class SingletonFactoryWithEmptyConstructor<T> where T : new(int)can you enforce that
Thas a static function (let's say,void F()) so that you can use this function inside the generic class? Like :class GenericClass<T> where T : void F() { void G () { T.F(); } }I know you can specify that
Timplements an interface but I don't want that. I want to specify thatThas a static function.