implicit indirection

Ali Çehreli acehreli at yahoo.com
Mon Nov 18 08:44:39 PST 2013


On 11/18/2013 08:18 AM, Carl Sturtivant wrote:
>
> struct Blah {
>    int val;
>    Blah* next;
> }
>
> Blah x, y;
> Blah* p;
>
> p = &x;
> p.next = &y; //don't need (*p).next --- very nice
>
> Can someone point me to where this feature of D is documented please.

Other than being "well known", I don't know where it is specified. :) I 
cover it under the "The . (dot) operator to access a member of the 
pointee" section here:

   http://ddili.org/ders/d.en/pointers.html

Ali



More information about the Digitalmars-d-learn mailing list