API:System.Generics.Defaults.TCustomComparer.GetHashCode

From RAD Studio API Documentation
Jump to: navigation, search

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

Returns an integer containing the hash code.

System.Generics.Defaults.TCustomComparer.GetHashCode inherits from System.TObject.GetHashCode. All content below this line refers to System.TObject.GetHashCode.

Returns an integer containing the hash code.

By default, calling GetHashCode on an object returns an integer representing the virtual address at which the object is stored.

Notes:
  • GetHashCode is supposed to be overridden in user-derived classes, to provide consumer objects with an integer hash code representation.
  • The sign of the hash code depends on the address of the particular object instance. Negative hash code can appear for object instances that reside at higher memory locations.

See Also