[fpc-devel] Little feature teaser

Dennis Poon dennis at avidsoft.com.hk
Sat Aug 3 05:23:36 CEST 2013


>>> What about code size?
>>>        
>>
>> The code size for one unit is the same as if you had (in that example)
>> declared a variant of "IsIn" for each "LongInt" and "String". So for each
>> "IsIn<T>" specialization with different types new code is generated if it
>> does not yet exist in that unit. This means that if you call "IsIn<LongInt>"
>> in different units you'll have a "IsIn<LongInt>" implementation in each
>> unit. This is the same as for generic types btw.
>>
>> Regards,
>> Sven
>>      
>
> And the same (problem) in C++. Is there some proposal to mitigate the
> code duplication? Or the official position is that if the project is
> big enough to suffer from the bloat it should avoid itself the
> duplicate declarations?
>
>
>    
If we create a third unit with a wrapper function in which it 
specializes the call, can we avoid the duplication code problem?

Dennis



More information about the fpc-devel mailing list