Thursday, 12 September 2013

Generic class and new() with interfaces

Generic class and new() with interfaces

Is there a way to use a generic class passing an interface as T and still
have the new() constraint?
Class Thing<T> where T : new()
new Thing<ISomething>()
I did not want Thing to be constrained by ISomething but I guess the idea
is just to keep adding interfaces to Thing?
Thanks

No comments:

Post a Comment