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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Apr 24 06:54:07 PDT 2015


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

--- Comment #4 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
(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.

--


More information about the Digitalmars-d-bugs mailing list