summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/tgeneric10.pp
blob: cd0c9fc9a3a18a9d17234208423fb5e21abac034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{$mode objfpc}

uses
  ugeneric10;

type
  TMyIntList = specialize TList<integer>;

function CompareInt(const Item1, Item2: Integer): Integer;
begin
  Result := Item2 - Item1;
end;

var
  ilist : TMyIntList;
  someInt : integer;
begin
  someInt:=10;
  ilist := TMyIntList.Create;
  ilist.add(someInt);
  ilist.sort(ilist.TCompareFunc(@CompareInt));
  writeln('ok');
end.