Generic Types and Methods - slide 9 : 21 |
It is possible to express a number of constraints on a formal type parameter
The more constraints on T, the more we can do on T-objects in the body of C<T>
class C<S,T>: D where T: A, ICloneable where S: B { ... } class E<T>: D where T: class{ ... } class F<T>: D where T: struct{ ... } class G<T>: D where T: new(){ ... }