> On Jan 10, 2018, at 6:37 AM, Graeme Geldenhuys 
> <mailingli...@geldenhuys.co.uk> wrote:
> 
> When using the Generics.Collections unit of Delphi I can define a list class 
> that can hold Integer data types, by doing the following:
> 
>  var
>    IntList: TList<Integer>;
>  begin
>    IntList := TList<Integer>.Create;
>    IntList.Add(12345);

I presume then TList<> and TList class are not implemented the same then 
because I still don’t know how the generic itself affects runtime performance.

Btw this looks like C# code because C# explicitly does not specialize at 
compile time but rather runtime so every instance will be using TList<Integer>. 
Does Delphi do this also? I think FPC requires you MUST specialize at compile 
time so simply using TList<Integer> won’t compile.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to