[fpc-pascal] Const params question

Michael Van Canneyt michael at freepascal.org
Wed Oct 11 14:11:16 CEST 2017

On Wed, 11 Oct 2017, Marcos Douglas B. Santos wrote:

> On Wed, Oct 11, 2017 at 7:01 AM, Michael Van Canneyt
> <michael at freepascal.org> wrote:
>> On Wed, 11 Oct 2017, Ryan Joseph wrote:
>>> If you declare a parameter as const does that effectively behave like
>>> passing by reference?  I have some performance sensitive functions that
>>> take records as arguments and I don’t want copying to the stack so I’ve
>>> been using @ but maybe const is just as good?  Thanks.
>> No, you need constref then.
> Is constref compatible with Delphi?

Delphi has recently introduced some annotation for the same purpose.

As usual, they chose to do something different than what FPC did.


More information about the fpc-pascal mailing list