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

zjh fqbqrr at 163.com
Fri Nov 26 02:00:38 UTC 2021


On Thursday, 25 November 2021 at 21:08:37 UTC, Imperatorn 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
> ```


Our `inout` first used to solved this problem.
Now, We should use it to solve this problem again.




More information about the Digitalmars-d mailing list