Zitat:
Delphi-Quellcode:
TList<T> = class(TEnumerable<T>)
function Add(const Value: T): Integer; inline;
//procedure AddRange(const Values: array of T); overload;
//procedure AddRange(const Collection: IEnumerable<T>); overload; inline;
//procedure AddRange(const Collection: TEnumerable<T>); overload; inline;
procedure Insert(Index: Integer; const Value: T); inline;
procedure InsertRange(Index: Integer; const Values: array of T); overload;
procedure InsertRange(Index: Integer; const Collection: IEnumerable<T>); overload;
procedure InsertRange(Index: Integer; const Collection: TEnumerable<T>); overload;
//function Remove(const Value: T): Integer; inline;
function RemoveItem(const Value: T; Direction: TDirection): Integer; inline;
procedure Delete(Index: Integer); inline;
procedure DeleteRange(AIndex, ACount: Integer); inline;
function ExtractItem(const Value: T; Direction: TDirection): T; inline;
//function Extract(const Value: T): T; inline;
procedure Exchange(Index1, Index2: Integer); inline;
procedure Move(CurIndex, NewIndex: Integer); inline;
procedure Clear; inline;
property Capacity: Integer read GetCapacity write SetCapacity;
property Count: Integer read FListHelper.FCount write SetCount;
property Items[Index: Integer]: T read GetItem write SetItem; default;
property List: arrayofT read FItems;
end;
Alleine das müsste man in XE8
überschreiben verdecken und wer weiß was zukünftig noch dazu kommt.
Man hat nur
Add erweitert (siehe oben), dann benutzt wer Insert und schon war es das.
Selbt
List ist geil, da dynamische Arrays ein (defektes) Speichermanagement besitzen und dieses Property somit nicht ReadOnly ist.