[fpc-pascal] passing a class parameter as a const

Florian Klaempfl florian at freepascal.org
Tue Jan 16 09:30:10 CET 2007


Michael Van Canneyt schrieb:
> 
> On Tue, 16 Jan 2007, Graeme Geldenhuys wrote:
> 
>> On 1/12/07, Michael Van Canneyt <michael.vancanneyt at wisa.be> wrote:
>>> It makes no difference, except that you cannot do
>>>
>>> AObject:=SomeOtherObject;
>>>
>>> in the first case.
>> Does Free Pascal work the same as Delphi 7 and earlier when you pass
>> interfaces around (and perhaps other auto reference counted types -
>> strings, dynamic arrays?). Without a classifier (const, var, out), an
>> interface argument reference count gets inc'd on the way in to the
>> function and dec'd on way out, resulting in calls to _AddRef and
>> _Release respectively on the interfaced argument.
> 
> As far as I know: yes.
> 
> But Florian Klaempfl should confirm this.

It does of course.



More information about the fpc-pascal mailing list