ohne Template würde es so aussehen sofern man die Items nur über das Property Items abfragt:
Delphi-Quellcode:
TMyList = class(TList)
protected
function GetNew(AIndex: Integer): TMyPointerType;
procedure PutNew(AIndex: Integer; AItem: TMyPointerType);
public
property Items[Index: Integer]: TMyPointerType read GetNew write PutNew; default;
end;
[...]
function TMyList.GetNew(AIndex: Integer): TMyPointerType;
begin
result := TMyPointerType(Get(AIndex));
end;
procedure TMyList.PutNew(AIndex: Integer; AItem: TMyPointerType);
begin
Put(AIndex, AItem);
end;