[fpc-devel] Proof of Concept ARC implementation

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Oct 30 04:15:23 CET 2014


Sven Barth schrieb:
> On 28.10.2014 09:57, Hans-Peter Diettrich wrote:

>>>>>  > Something like ShortString and AnsiString?

>>> Take unit Typinfo for example where quite some methods take a TObject
>>> instance.
>>
>> The TypInfo methods can determine the exact type of their arguments, and
>> act inside accordingly.
> 
> If you have a method X that takes a TObject parameter how do you plan to 
> pass it a reference counted object when these and TObject are not 
> compatible *at compiletime*?

That's intentionally impossible in general. For TypInfo, a dedicated 
method (override) can be added, or an untyped parameter can be used like 
in FreeAndNil.

DoDi




More information about the fpc-devel mailing list