* Add delphi-compatible TList constructor with array of values

This commit is contained in:
Michaël Van Canneyt 2025-02-28 10:12:43 +01:00
parent 70591f6449
commit e958ad5126

View File

@ -266,6 +266,7 @@ type
constructor Create; overload;
constructor Create(const AComparer: IComparer<T>); overload;
constructor Create(ACollection: TEnumerable<T>); overload;
constructor Create(aValues : Array of T); overload;
{$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers}
constructor Create(ACollection: TEnumerableWithPointers<T>); overload;
{$ENDIF}
@ -1617,6 +1618,16 @@ begin
Add(LItem);
end;
constructor TList<T>.Create(aValues : Array of T);
var
LItem: T;
begin
Create;
for LItem in aValues do
Add(LItem);
end;
{$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers}
constructor TList<T>.Create(ACollection: TEnumerableWithPointers<T>);
var