<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">Am 11.01.2018 08:06 schrieb "Michael Schnell" <<a href="mailto:mschnell@lumino.de">mschnell@lumino.de</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><div class="quoted-text">
On 09.01.2018 08:04, Sven Barth via fpc-pascal wrote:<br>
<blockquote type="cite">
<div dir="auto">
<div>
<div class="gmail_extra">
<div dir="auto">But you need to program in a way that allows
the usage of multiple, different types. That can more
often than not lead to worse performance. <br>
</div>
</div>
</div>
</div>
</blockquote></div>
Seemingly it is done that way. <br>
<br>
I rather often did a kind of "Generics" in ANSI C by using Macros.
It's catastrophic for code writing and for debugging but does not
impose any performance issues. <br>
<br>
I suppose there is a reason why in Pascal Generics are not
translated in multiple dedicatedly typed code snippets at compile
time. </div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Huh? A generic is reparsed for every type tuple it is specialized with (except of course it already finds an existing previous specialization for these types), but you need to write the generic's code in a way that satisfies the parser for all these types (though FPC is more lenient here than Delphi). </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven</div></div>