How to return a reference to structs?

Andrey Zherikov andrey.zherikov at gmail.com
Thu Nov 4 13:15:51 UTC 2021


On Thursday, 4 November 2021 at 13:03:54 UTC, Paul Backus wrote:
> Have the lambda return by reference:
>
> ```d
> auto get()
> {
>     return idx.map!(ref (i) => a[i]);
> }
> ```

That works, thanks!


More information about the Digitalmars-d-learn mailing list