[fpc-pascal] How to use generics and meta class?

luiz americo pereira camara luizmed at oi.com.br
Thu Feb 27 23:56:05 CET 2014


2014-02-27 18:43 GMT-03:00 Joao Morais <l at joaomorais.com.br>:

> Correct. The feature I was talking about is something like:
>
> generic TMyGeneric<T: TMyType>
>
> And TMyType is a class. In this case the compiler knows I am talking about
> a generic for a class type and a "generic as Java" becomes possible.



Seems that you are looking to class type constraints:

http://docwiki.embarcadero.com/RADStudio/XE4/en/Constraints_in_Generics
http://blogs.teamb.com/craigstuntz/2008/08/29/37832

Not sure if will allows to do what you are looking for

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


More information about the fpc-pascal mailing list