GenericClass<T1, T2> Class
Public Class GenericClass(Of _
T1 As IComparer, _
T2)
This language is not supported or no code example is available.
public class GenericClass<T1, T2>
where T1 : IComparer
This language is not supported or no code example is available.
type GenericClass<'T1, 'T2
when 'T1 :> IComparer> = class end
This language is not supported or no code example is available.
generic<typename T1, typename T2>
where T1 : IComparer^
public ref class GenericClass
This language is not supported or no code example is available.
Type Parameters
- T1
The first type parameter.
- T2
The second type parameter.
| Name | Description | |
|---|---|---|
|
Equals(object, object) | Determines whether the specified object instances are considered equal. (inherited from object). |
|
Equals(object) | Determines whether the specified object is equal to the current object. (inherited from object). |
|
~Object() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from object). |
|
GetHashCode() | Serves as the default hash function. (inherited from object). |
|
GetType() | Gets the Type of the current instance. (inherited from object). |
|
MemberwiseClone() | Creates a shallow copy of the current object. (inherited from object). |
|
Mm1(List<Int32>[]) | A method with a parameter of constructed type (bound generic type). |
|
Mm2(List<T1>) | A method with a parameter of generic type from the owner class. |
|
Mm3(List<T2>) | A method with a parameter of generic type from the owner class. |
|
Mm4<T3>(List<T2>) | A generic method with a parameter of generic type from the owner class. |
|
ReferenceEquals(object, object) | Determines whether the specified object instances are the same instance. (inherited from object). |
|
ToString() | Returns a string that represents the current object. (inherited from object). |
| Name | Description | |
|---|---|---|
|
NestedGenericClass<T3> | A nested generic class (unbound generic type). |
The link to this member has the following syntax:
<see cref="T:SampleClassLibrary.GenericClass`2"/>
Generics nomenclature
Generic types introduce and use the following terms:
- Unbound Generic Type - A definition of a class, structure, interface, procedure, or
delegate for which you supply at least one data type when you declare it. An
unbound generic type is not itself a type, and cannot be used as the type of a
variable, argument or return value, or as a base type. The only construct in
which an unbound generic type can be referenced is the typeof expression.
public class List<T> - Type Parameter - In an unbound generic type definition, a placeholder for a data
type you supply when you declare the type.
public class List<T> - Type Argument - A specific data type that replaces a type parameter when you
declare a constructed type from an unbound generic type.
public class List<int> - Constraint - A condition on a type parameter that restricts the type argument
you can supply for it. A constraint can require that the type argument must
implement a particular interface, be or inherit from a particular class, have an
accessible parameterless constructor, or be a reference type or a value type.
You can combine these constraints, but you can specify at most one class.
public class genericClass where T : System.Collections.IComparer - Constructed Type (bound generic type) - A class, structure, interface, procedure, or delegate declared
from an unbound generic type by supplying type arguments for its type
parameters.
public class List<int>
Rules for the cref syntax:
- Type parameters in unbound types are replaced by `number_of_params
- Type parameters in unbound non-types (methods, props, ...) are replaced by ``number_of_params
- Type arguments are enclosed inside { }. Moreover, if type argument is a type parameter of containing class(es), it is replaced by its index starting from zero prepended by `. This index is agregated from outermost class, it isn't set to zero in nested generic class.
- Constraints are removed.
SampleClassLibrary.GenericClass<T1, T2>