c# - Generic class definition with both generic type constraint and inherited type? -
i wondering if possible have both generic type constraint , inherited type?
i not figure syntax out myself or think of possible example at.
code example:
public class test<t> t : itest, new() : ibasetest { }
is possible achieve class definition this?
public class test<t> : ibasetest t : itest, new() { }
your class implement interface ibasetest
, , generic parameter t
constrained types implementing interface itest
, having default (parameterless) constructor.
is meant?
Comments
Post a Comment