[fpc-pascal] Generics vs templates
pascaldragon at googlemail.com
Mon Jan 8 11:58:01 CET 2018
Am 08.01.2018 08:50 schrieb "Ryan Joseph" <ryan at thealchemistguild.com>:
I was talking with a c++ developer who explained how templates are
implemented in c++ and how use some recursive method which causes them to
totally murder compile times. This isn’t the first I’ve heard of the
problem though and I recall some game studios who develop engines in c++
saying they are strictly off limits for the same reasons.
Having just started to use generics in FPC myself I was curious if FPC
suffers from the same problem of slow compile times?
FPC essentially reparses a generic during specialization so I'd say that
they definitely affect compile times. However we're still only doing a
single pass of parsing. This while the compilation might be slower it might
not be as bad as with a C++ compiler.
As far as I know no one has done a benchmark for that however.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal