[fpc-devel] Templates / Generics

Marc Weustink marc.weustink at cuperus.nl
Fri Nov 4 10:27:06 CET 2005


Micha Nelissen wrote:
> Marc Weustink wrote:
> 
>> Peter Vreman wrote:
>>
>>> How will Delphi handle the following case with overloads and 
>>> different types:
>>
>>
>> If the generic is "pre"compiled (which is maybe necesary if you need 
>> access to privates) then I fear some runtime logic has to be added to 
>> call the correct procedure. IE. something like
>>
>>   case TypeInfo(Data) of
>>     StringType: Show(Data);
>>     IntegerType: Show(Data);
>>   end;
> 
> 
> The whole idea of Generics is to avoid this :-)

I mean generated by the compiler, not by the "user"

Marc




More information about the fpc-devel mailing list