www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Why was scope for allocating classes on the stack marked for

reply "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
I'm curious as to why using scope to allocate classes on the 
stack was marked for future deprecation.

I mean, sure it could be potentially unsafe, but the new library 
solution (using std.typecons.scoped) does the exact same thing 
and is just as unsafe for the same reasons, is it not? I would 
rather continue to use the keyword scope instead of having to 
import another module in order to use this feature.
Oct 17 2014
parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Friday, 17 October 2014 at 16:56:50 UTC, Jeremy DeHaan wrote:
 I'm curious as to why using scope to allocate classes on the 
 stack was marked for future deprecation.
It was never implemented correctly (it is supposed prove it never leaves the scope, and is thus safe to be on the stack), so rather than keep a half baked feature in the language, the gang wanted to move it to the library where at least the usage wouldn't look as normal given the memory safety problems.
Oct 17 2014