<div dir="ltr"><div>Hi,</div><div><br></div><div>I am trying to have some code that uses generics to compile under Delphi and under FPC (uses fgl)</div><div><br></div><div>In Delphi I pass IComparer<T> and in FPC TCompareFunc<T></div><div><br></div><div>IComparer<T> is an object and I can create it with some state that compare method can use :)</div><div><br></div><div>In FPC I should pass function:</div><div><br></div><div>TCompareFunc = function(const Item1, Item2: T): Integer;</div><div><br></div><div>And I am not sure where I can add my state information that compare will use - it is not and object function :(</div><div><br></div><div>Any help will be appreciated!</div><div><br></div><div>Thanks,</div><div>Gennady</div><div><br></div><div><br></div></div>