Mega Code Archive

 
Categories / C# / Generics
 

There are five types of constraints

/*     *Derivation constraints state the ascendancy of a type parameter.     *Interface constraints are interfaces that are implemented by the type parameter.     *Value type constraints restrict a type parameter to a value type.     *Reference type constraints restrict a type parameter to a reference type.     *Constructor constraints stipulate that the type parameter has a default or parameterless constructor. */