This commit is contained in:
Michael Schimmel
2026-01-04 18:48:04 +01:00
parent a4afae6f39
commit 991b998cb1
17 changed files with 534 additions and 102 deletions
+28
View File
@@ -12,6 +12,34 @@ type
property Count: Integer read GetCount;
end;
// Concrete generic implementation
TTupleImpl<T> = class(TInterfacedObject, ITuple<T>)
private
FItems: TArray<T>;
function GetItems(Idx: Integer): T;
function GetCount: Integer;
public
constructor Create(const AItems: TArray<T>);
end;
implementation
{ TTupleImpl<T> }
constructor TTupleImpl<T>.Create(const AItems: TArray<T>);
begin
inherited Create;
FItems := AItems;
end;
function TTupleImpl<T>.GetCount: Integer;
begin
Result := Length(FItems);
end;
function TTupleImpl<T>.GetItems(Idx: Integer): T;
begin
Result := FItems[Idx];
end;
end.