A question about move() and a rant about shared

Stanislav Blinov stanislav.blinov at gmail.com
Sat Jan 25 23:21:13 PST 2014


On Saturday, 25 January 2014 at 18:47:17 UTC, Andrei Alexandrescu 
wrote:

>
> We plan to disallow taking address of a ref return from a 
> function.
>

What about sneaky cases? E.g. like this:

NullableRef!T nref(T)(ref T v) { return NullableRef!T(&v); }

struct Container(T) {
     //...
     ref inout(T) front() inout { ... }
}

Container!int cnt;

//...

auto n = nref(cnt.front());


More information about the Digitalmars-d mailing list