Return value storage classes - `scope` as well as `ref`

Nick Treleaven nick at geany.org
Wed May 31 10:29:06 UTC 2023


On Tuesday, 30 May 2023 at 07:21:44 UTC, Dukc wrote:
> On the other hand, `return` (without the trailing `scope`, 
> `return ref` when applied to a parameter) means the return 
> value is `scope` if the struct is in a stack. Maybe that's what 
> you intended  `S.fp` to be.

Yes, thanks I didn't know that. I'm not sure if that's documented 
anywhere in the spec.
https://dlang.org/spec/function.html#return-scope-parameters

This also resolves the bugzilla issue:
https://issues.dlang.org/show_bug.cgi?id=17934#c12


More information about the Digitalmars-d mailing list