Browse Source

* Add TList.ExtractAt for delphi compatibility

Michaël Van Canneyt 1 year ago
parent
commit
b07818e51b
1 changed files with 9 additions and 0 deletions
  1. 9 0
      packages/rtl-generics/src/generics.collections.pas

+ 9 - 0
packages/rtl-generics/src/generics.collections.pas

@@ -290,6 +290,7 @@ type
     procedure Delete(AIndex: SizeInt); inline;
     procedure DeleteRange(AIndex, ACount: SizeInt);
     function ExtractIndex(const AIndex: SizeInt): T; overload;
+    Function ExtractAt(const AIndex: SizeInt): T; inline;
     function Extract(const AValue: T): T; overload;
 
     procedure Exchange(AIndex1, AIndex2: SizeInt); virtual;
@@ -1749,6 +1750,14 @@ begin
   Result := DoRemove(AIndex, cnExtracted);
 end;
 
+
+function TList<T>.ExtractAt(const AIndex: SizeInt): T;
+begin
+  Result:=ExtractIndex(AIndex);
+end;
+
+
+
 function TList<T>.Extract(const AValue: T): T;
 var
   LIndex: SizeInt;