Martin wrote:

I saw the error in my thinking, after Jonas (re-) explained the meaning of "const".

and I guess it applies to other types to (as long as they are passed by reference): e.g records are likely to see changes too...

Indeed. I was initially not completely correct, and should have said:
the 'const' modifier prevents creation of the local copy of the argument.
The exact way of creating local copy depends on the argument type: for reference-counted types, it is done by manipulating the refcount, other types like shortstrings use a plain copy, etc.

Regards,
Sergei
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to