mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 14:59:32 +02:00
* Add delphi-compatible TList constructor with array of values
This commit is contained in:
parent
70591f6449
commit
e958ad5126
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user