> Templates' pros: > - support of primitive types; > - flexibility (ability to call non-virtual and non-related methods, > operators, etc); > - ability of coding for speed. > > Type erasure generics' pros: > - No additional generated code, no code bloat; > - Code is easier to understand (no additional trips for symbol resolution); > - Easy (possible ;-) to debug. > - Much easier to implement (in the compiler) ;-)
What I don't understand is all these differences between templates and generics while the only difference is that for classes you do type erasure. Note that for reference types you can also do type erasure under FPC _AND_ classes are always reference types. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel