blob: 9469da8c19c55110185dcc386e0d966dc0eb40f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
{$mode objfpc}{$H+}
type
generic TGListItem<T> = class(TObject)
public
FNext: TGListItem;
procedure Assign(Source: TGListItem);
end;
procedure TGListItem.Assign(Source: TGListItem);
begin
FNext := Source;
end;
type
TIntListItem = specialize TGListItem<Integer>;
var
A, B: TIntListItem;
begin
A := TIntListItem.Create;
B := TIntListItem.Create;
A.Assign(B);
if A.FNext <> B then
halt(1);
end.
|