DIP1000: The return of 'Extend Return Scope Semantics'

Atila Neves atila.neves at gmail.com
Wed May 26 12:34:56 UTC 2021


On Tuesday, 25 May 2021 at 11:24:59 UTC, Dennis wrote:
> ## Background
>
> The `return` attribute allows you to return a scope variable.
> The compiler knows that the returned value has the same 
> lifetime as the argument passed to the function.
> ```D
> // ┌───────────<──────────┐
> int* identity(return int* x) @safe {
>     return x;
> }
>
> [...]

These are *very* good questions.


More information about the Digitalmars-d mailing list