Constraints on Type Parameters (C# Programming Guide)

http://msdn.microsoft.com/en-us/library/d5x73970(VS.80).aspx
When you define a generic class, you can apply restrictions to the kinds of types that client code can use for type arguments when it instantiates your class. If client code attempts to instantiate your class with a type that is not allowed by a constraint, the result is a compile-time error. These restrictions are called constraints. Constraints are specified using the where contextual keyword. The following table lists the six types of constraints:

0 Response to "Constraints on Type Parameters (C# Programming Guide)"