DIP1000: Walter's proposal to resolve ambiguity of ref-return-scope parameters

Imperatorn johan_forsberg_86 at hotmail.com
Thu Nov 25 21:16:52 UTC 2021


On Thursday, 25 November 2021 at 21:08:37 UTC, Imperatorn wrote:
> On Thursday, 25 November 2021 at 20:45:41 UTC, Stanislav Blinov 
> wrote:
>> [...]
>
> Don't forget 😁
> ```d
> ref what() return;
> ref the() return scope;
> ref fuck() return ref scope;
>
> auto ref what() return;
> auto ref the() return scope;
> auto ref fuck() return ref scope;
>
> auto ref f1(int x)     { return x; }  // value return
> auto ref f2()          { return 3; }  // value return
> auto ref f3(ref int x) { return x; }  // ref return
> auto ref f4(out int x) { return x; }  // ref return
> auto ref f5() { static int x; return x; }
>
> // etc
> ```

Sorry I meant
```d
@safe @nogc pure nothrow auto ref fuck(ref int x) return ref 
scope;
```


More information about the Digitalmars-d mailing list