www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - implicit indirection

reply "Carl Sturtivant" <sturtivant gmail.com> writes:
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.
Nov 18 2013
parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
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
Nov 18 2013