[fpc-pascal] Generics vs templates

Michael Schnell mschnell at lumino.de
Tue Jan 9 11:57:24 CET 2018

On 09.01.2018 08:04, Sven Barth via fpc-pascal wrote:
> 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.
Seemingly it is done that way.

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.

I suppose there is a reason why in Pascal Generics are not translated in 
multiple dedicatedly typed code snippets at compile time.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180109/e801280f/attachment.html>

More information about the fpc-pascal mailing list