[fpc-devel] Templates / Generics

Micha Nelissen micha at neli.hopto.org
Fri Nov 4 10:25:15 CET 2005


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

Micha




More information about the fpc-devel mailing list