[fpc-devel] Aligned dynamic arrays
Mattias Gaertner
nc-gaertnma at netcologne.de
Sat Mar 30 17:53:55 CET 2019
On Sat, 30 Mar 2019 10:03:12 -0400
Ryan Joseph <ryan at thealchemistguild.com> wrote:
> > On Mar 30, 2019, at 9:55 AM, Jonas Maebe <jonas at freepascal.org>
> > wrote:
> >> You are not required to dereference pointers to write to them.
> >> var
> >> P: PPoint;
> >> begin
> >> P := AlignedArray[0];
> >> P.X := 3; // can be okay
> >> AlignedArray[0].Y := 4; // can be okay as well
> >
> > That only works in {$mode delphi}
>
> Oh that’s why! How does this work in Delphi mode without pointers and
> why wasn’t it added to ObjFPC mode?
I guess you mean auto dereferencing.
{$ModeSwitch AutoDeref}
> That would have saved me some
> headache in the past if I knew this.
Mattias
More information about the fpc-devel
mailing list