In System.Generics.Collections
, the TArray
type has class functions only.
For example:
class procedure Sort<T>(var Values: array of T); overload; static;
This implies the only accepted syntax is the following:
var
Arr : TArray<integer>;
begin
SetLength(Arr, 2);
Arr[0] := 5;
Arr[1] := 3;
TArray.Sort<integer>(Arr);
end;
I would like to define an object's function in order to sort the values of the generic array using the following syntax:
var
Arr : TArray<integer>;
begin
SetLength(Arr, 2);
Arr[0] := 5;
Arr[1] := 3;
Arr.Sort();
end;