<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">Am 10.01.2018 05:10 schrieb "Ryan Joseph" <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text"><br>
<br>
> On Jan 10, 2018, at 6:37 AM, Graeme Geldenhuys <<a href="mailto:mailinglists@geldenhuys.co.uk">mailinglists@geldenhuys.co.uk</a><wbr>> wrote:<br>
><br>
> When using the Generics.Collections unit of Delphi I can define a list class that can hold Integer data types, by doing the following:<br>
><br>
>  var<br>
>    IntList: TList<Integer>;<br>
>  begin<br>
>    IntList := TList<Integer>.Create;<br>
>    IntList.Add(12345);<br>
<br>
</div>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.<br>
<br>
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.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">That are two orthogonal points. FPC and Delphi both allow inline specializations which is what you see above (in the non-Delphi modes of course with the "specialize" keyword). That doesn't change that such specializations are done at compile time. For the compiler it is as if the type "TList<Integer>" exists as a full type wherever it is used. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div></div>