Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.0.0 / tests / test / ugeneric10.pp
Size: Mime:
unit ugeneric10;

{$mode objfpc}

interface

type
   generic TList<_T>=class(TObject)
   public
     type
       TCompareFunc = function(const Item1, Item2: _T): Integer;
   public
     var
       data : _T;
     procedure Add(item: _T);
     procedure Sort(compare: TCompareFunc);
   end;

implementation

procedure TList.Add(item: _T);
begin
  data:=item;
end;

procedure TList.Sort(compare: TCompareFunc);
begin
  if compare(data, 20) <= 0 then
    halt(1);
end;

end.