On Fri, 12 Jan 2007, Graeme Geldenhuys wrote:

> Hi
> 
> Does passing a class parameter as a const make any difference?
> 
> eg:
> 
>  Add(const AObject: TtiObject);
> 
>      vs
> 
>  Add(AObject: TtiObject);
> 
> 
> >From what I can see it shouldn't.  Most Delphi code and Free Pascal
> FCL code doesn't use 'const' for class parameters.

It makes no difference, except that you cannot do

AObject:=SomeOtherObject;

in the first case.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to