Why can't I give a function's return type the scope storage class?

Walter Bright newshound2 at digitalmars.com
Tue Mar 19 03:12:24 UTC 2019


On 3/18/2019 7:22 PM, Meta wrote:
> I think what you meant was this:
> 
> T* doSomething(return scope T*);
> 
> scope val = doSomething(someOtherVal);
> 
> Right?

Yes, except it is unnecessary to mark val as scope. The compiler will attach 
scope to it automatically if someOtherVal is scope.


More information about the Digitalmars-d mailing list