System.TObject.GetHashCode

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetHashCode: Integer; virtual;

C++

virtual int __fastcall GetHashCode(void);

Properties

Type Visibility Source Unit Parent
function public
System.pas
systobj.h
System TObject

Description

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