On 29.10.2014 16:17, hinsta...@yandex.ru wrote:
I suggest leaving TList from FPC RTL as is. It works with pointers, so leave it 
be.

For refcounted objects we would use generic list like TFPGList from fgl unit. 
However, currently existing TFPGList implementation would be unable to deal 
with refcounted objects correctly because TFPGLists uses TFPSList (u can 
examine source file if interested), and TFPSList moves items like memory 
blocks. So TFPGList can not store refcounted objects just like it can not store 
interface vars.

A generic class capable of storing interfaces and refc-objects correctly will 
need to use dynamic arrays under the hood because with dynamic arrays you don't 
loose type information

You are wrong. TFPGList works correctly with reference counted types, because it overrides the necessary functions of TFPSList (mainly CopyItem). Afterall TFPGList<AnsiString> works without problems ;)

Regards,
Sven

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to