[fpc-devel] Generics

Vincent Snijders vsnijders at quicknet.nl
Thu Apr 13 10:35:35 CEST 2006


Marc Weustink wrote:
> Flávio Etrusco wrote:
> 
>> On 4/12/06, Bisma Jayadi <bisma at brawijaya.ac.id> wrote:
>>
>>>> It isn't clear to me what the current status about Generics is:
>>>> http://www.freepascal.org/wiki/index.php/Generics
>>>
>>>
>>> http://www.dummzeuch.de/delphi/object_pascal_templates/english.html
>>>
>>> http://community.borland.com/article/0,1410,27603,00.html
>>
>>
>>
>>
>> Ingenious! I really feel stupid for not thinking of something that
>> simple like this before :-)
> 
> 
> Is it possible this way to "derive" 2 (or more) classes in one unit from 
> the same generic ?
> 

 From http://community.borland.com/article/0,1410,27603,00.html

> The only requirements when implementing templates this way is that each new type should be declared in a separate unit and you should have the sources for the generic classes.

So, no.

Of course if you use macros in fpc, you can. See for example the format 
shortstring and ansistring implementations.

Vincent.



More information about the fpc-devel mailing list