[fpc-devel] Question on constref

Ondrej Pokorny lazarus at kluug.net
Thu Feb 2 12:41:00 CET 2023


On 02.02.2023 12:25, Mattias Gaertner via fpc-devel wrote:
> On Thu, 2 Feb 2023 12:00:31 +0100
> Ondrej Pokorny via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
>
>> [...]
>> Delphi cannot do it. FPC rocks!
> +1
>
>> The only disadvantage is that you get a FreeAndNil copy for every
>> type you pass into the parameter (?)
>>
>> Do we want to change it in SysUtils? :)
> I got a feeling this solves a problem no one had.

I agree with that.

But you know, pascal is strongly typed. You should get a compiler 
warning when passing an incompatible parameter and not an AV in runtime. 
Like the Pos(Variant) issue :)

Ondrej



More information about the fpc-devel mailing list