[fpc-devel] Templates / Generics Syntax

Vincent Snijders vsnijders at quicknet.nl
Fri Nov 4 14:11:04 CET 2005


Ales Katona wrote:
> 
>> Example:
>>
>> procedure MyProc(T); // generic procedure without parameters
>> ver i: T;
>> begin
>>  ...
>> end;
>>
>> procedure MyProc(T: TClass); // non generic procedure
>> begin
>> end;
>>
>> Call
>>
>> MyProc(TObject);
>>
>> What will happen?
>>
>> Mattias
>>  
>>
> 
> Sky will reign fire:
> 
> procedure (var T);
> begin
>  // generic or not??
> end;

So, just as with class procedures, we need an extra modifier.

generic procedure (var T);
begin
// generic
end;
and
procedure (var T);
begin
// not generic
end;

Vincent.



More information about the fpc-devel mailing list