System.Generics.Defaults.TCustomComparer.GetHashCode
Delphi
function GetHashCode(const Value: T): Integer;
C++
HIDESBASE virtual int __fastcall GetHashCode(const T Value) = 0 /* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | protected | System.Generics.Defaults.pas System.Generics.Defaults.hpp |
System.Generics.Defaults | TCustomComparer |
Description
GetHashCode is a generic method used to generate a hash code for a given value.
Use the GetHashCode method to generate a hash code for the given input value. Any class that derives from TCustomComparer is expected to implement the GetHashCode method.
Note: The generated hash codes are not required to be unique. Still, we recommend that the generated values be as different as possible from one another. Two equal values are required to have the same hash code, while two different values are not required to have different hash codes.
See Also
- System.Generics.Defaults.TCustomComparer.Equals
- System.Generics.Defaults.TCustomComparer.Compare
- System.Generics.Defaults.IComparer
- System.Generics.Defaults.IEqualityComparer
- System.Generics.Defaults.TOrdinalIStringComparer.GetHashCode
- System.Generics.Defaults.THasher.Invoke