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());

Reply via email to