[fpc-devel] UnicodeString and RTL

Florian Klaempfl florian at freepascal.org
Thu Nov 20 15:23:22 CET 2008


Graeme Geldenhuys schrieb:
> On Thu, Nov 20, 2008 at 4:10 PM, Aleksa Todorovic <alexionne at gmail.com> wrote:
>> Or... it could be implemented using generics, so one can choose:
>>
>> TStringList<UnicodeString>
>> TStringList<AnsiString>
>> TStringList<ShortString>
>>
>> (sorry for C++ish syntax, but I hope you understand)
> 
> 
> I somehow managed to skip the whole generics thing and have no clue
> how they work, but I will give it a once over before I start the
> TStrings and TStringList implementations.  Maybe I can hit two birds
> with one stone. :-)

See http://svn.freepascal.org/svn/fpc/trunk/rtl/objpas/fgl.pp

The trick is to have an type independend core class and a type aware
wrapper. This keeps the executable size low even with a lot of
specializations.



More information about the fpc-devel mailing list