"scope attribute" vs "scope keyword" vs "scope storage class"

Dicebot public at dicebot.lv
Thu Feb 6 14:16:28 PST 2014


On Thursday, 6 February 2014 at 19:01:52 UTC, Brad Anderson wrote:
> On Wednesday, 5 February 2014 at 15:43:45 UTC, Dicebot wrote:
>>
>> D documentation has rather incosistent naming for attribute 
>> groups.
>>
>> - scope classes are deprecated, but usage of scope as storage 
>> class is still legal (it is expected to be a no-op for now)
>>
>
> Couldn't "scope" allocating a class on the stack just be 
> considered an optimization that can be applied if the scope 
> storage class become fully implemented?

I think so. Scope classes were unsafe because of leaking 
references but if `scope` is actually implemented to assure 
safety it becomes perfectly valid thing to do.

>> - scope storage class for function parameters is also accepted 
>> as no-op. For delegates it actually has a meaning. No 
>> deprecation.
>>
>
> No-op just because it hasn't been implemented yet, right?

Yes. And there is no clear definition either.


More information about the Digitalmars-d-learn mailing list