On Tue, 05 Feb 2013 13:33:35 -0500, Andrei Alexandrescu <[email protected]> wrote:

Walter and I reviewed the discussion and had a long talk. We are very seriously considering banning the use of & against a ref result from a function (and actually ref parameters and even struct members in @safe code). One would still be able to take the address of a field in a class because that's assumed to live on the GC heap.

Thinking about this some more, would this be allowed:

@trusted T *getAddr(T)(ref T obj) { return &obj; } // allowed? You said only @safe code would disallow address of ref parameters

-Steve

Reply via email to