unit tw22540; interface {$ifdef FPC} {$Mode Delphi} {$endif} {$pointermath on} // Be more objfpc like in overindexing and removing of ^. {$inline on} type {$ifndef FPC} Ptrint=integer; {$endif} TLightMap = class Type PKey = ^TKey; PValue= ^TValue; TKeyCompareFunc = function(const Key1, Key2: TKey): Integer; // returns Integer both in FPC and Delphi TFinalizeKeyFunc = Procedure(var Key1:TKey) of object; private keycomparefunc:TKeyCompareFunc; finalizekeyfunc:TFinalizeKeyFunc; // finalize keys. NIL if unused. public constructor Create; virtual; end; TLightStringMap = class(TLightMap) constructor create; override; procedure finalizestring(var s:string); end; TLightStringMapInteger = class(TLightStringMap); implementation Uses Sysutils; { TLightMap } constructor TLightMap.Create; begin end; { TLightStringMap } constructor TLightStringMap.create; begin inherited; keycomparefunc:=comparestr; finalizekeyfunc:=finalizestring; end; procedure TLightStringMap.finalizestring(var s: string); begin finalize (s); end; end.