Confused about referencing in D

kink via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 14 02:30:46 PDT 2016


On Thursday, 14 July 2016 at 06:23:15 UTC, Gorge Jingale wrote:
> I think that the assignment in the first case is not assigning 
> the reference returned by auto ref GetValue().

Yep. There's no such thing as C++ `auto& val = GetValue()` in D. 
You'd have to use a pointer instead: `auto pVal = &GetValue()`.


More information about the Digitalmars-d-learn mailing list