[Issue 14492] Deprecate scope for allocating classes on the stack

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Apr 24 08:16:56 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14492

--- Comment #6 from yebblies <yebblies at gmail.com> ---
(In reply to Jonathan M Davis from comment #4)
> (In reply to yebblies from comment #3)
> > As Jonathan said, it's used in DDMD.  What we really need is a way to make
> > it @safe, not deprecating it.
> 
> Why aren't you using std.typecons.scoped? In theory, at least, that's
> supposed to replace all uses of scope classes. But regardless, I don't see
> how you could possibly make it @safe without somehow guaranteeing that no
> reference to the object escapes, and I'd be surprised if you could talk
> Andrei into thinking that scope should stay. I'm not sure what Walter's take
> on it would be though. But it _was_ decided some time ago that scope classes
> were being gotten rid of, so it's not like this is new.

To avoid depending on phobos, for now.  If we get some form of 'scope' in the
language eventually we will hopefully be able to use it safely again.

--


More information about the Digitalmars-d-bugs mailing list