Create class on stack

Moritz Maxeiner via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 7 15:49:55 PDT 2017


On Monday, 7 August 2017 at 22:02:07 UTC, Mike wrote:
> On Monday, 7 August 2017 at 13:42:33 UTC, Moritz Maxeiner wrote:
>
>>> You can still create a (scope) class on the stack, escape a 
>>> reference to it using `move` and use it afterwards, all 
>>> within the rules of @safe, so I'm not convinced that the 
>>> reason for deprecating scoped classes is gone yet.
>>> Compare this to `scoped`, which behaves as expected (since it 
>>> wraps the reference type object in a value type):
>
> Looks like a bug to me.  I recommend submitting a bug report 
> and tag it somehow with "scope" and/or "DIP1000".  It appears 
> Walter is giving any bugs with scope/DIP1000 priority.

Thanks for the feedback, done: 
https://issues.dlang.org/show_bug.cgi?id=17730


More information about the Digitalmars-d-learn mailing list