从 TListT 下降使其具体化
type
TIntegerList = class(TList<Integer>)
public
function Sum: Integer;
end;
...
function TIntegerList.Sum: Integer;
var
Item: Integer;
begin
Result := 0;
for Item in Self do
Result := Result + Item;
end;
type
TIntegerList = class(TList<Integer>)
public
function Sum: Integer;
end;
...
function TIntegerList.Sum: Integer;
var
Item: Integer;
begin
Result := 0;
for Item in Self do
Result := Result + Item;
end;