[fpc-devel] Generics

Marco van de Voort marcov at stack.nl
Sun Apr 9 21:57:57 CEST 2006


> > > 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

What compiler? If gcc, gcc does nothing fast, and C++ header model than the
bit of codegenerating done.

> 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...

The "Type erasure" in Java5 is also known to have pitfalls. E.g. check the
site of http://www.angelikalanger.com or just throw "type erasure" in
google.




More information about the fpc-devel mailing list