Syntax ideas for `ref` returning delegate and FP parameters

Nick Treleaven nick at geany.org
Sat Apr 10 15:26:16 UTC 2021


On Saturday, 10 April 2021 at 14:27:31 UTC, Q. Schroll wrote:
> ```D
> alias refDG = ref int delegate();
> void f(refDG dg) { .. }
> ```
> without an alias. The obvious idea is allowing
> ```D
> void f(int delegate() ref dg)
> ```
> but I really dislike not having `ref` next to the return type.

I don't mind that. Also this (particularly if std.meta.Alias was 
in object.d) is a workaround:

void f(Alias!(ref int delegate()) dg);


More information about the Digitalmars-d mailing list