[fpc-devel] Generics

Flávio Etrusco flavio.etrusco at gmail.com
Sun Apr 9 21:43:53 CEST 2006

On 4/9/06, Florian Klaempfl <florian at freepascal.org> wrote:
> Flávio Etrusco wrote:
> > On 4/9/06, Florian Klaempfl <florian at freepascal.org> wrote:
> >> rstar at mnet-online.de wrote:
> >> (...)
> >> Is there already a specification how they will look like in Delphi?
> >>
> >>> (.net2)? What's planned? Can somebody explain?
> >>>
> >> They are more like C++ templates.
> >
> > What? Do you mean that FPC implementation of generics wouldn't be
> > based on "type erasure" but on beefed-up-precompiler-macros? Please
> > say I got it all wrong :-o
> You want crippled generics regarding speed and usage like C# has? You
> can do this with "real" templates as well using an implementation class
> and wrapper templates.

I've never heard any critics/complaints on the performance of generics
in Java (I'm not much into .net 2 yet), but you certainly know better
than me.
I guess I was a bit too hasty on the whining, but just thinking about
C++ compilation speed when using templates give me cries... TBH I
never tried using "type erasure" in C++ templates, but I remember C++
templates' inner workings to have enough pitfalls for me to want to
avoid templates at all costs...


More information about the fpc-devel mailing list