ElementType of MapResult is a delegate??
John Chapman
johnch_atms at hotmail.com
Sat Dec 8 13:19:38 UTC 2018
On Saturday, 8 December 2018 at 13:02:00 UTC, Yuxuan Shui wrote:
> This surprised me A LOT:
>
> https://d.godbolt.org/z/82a_GZ
>
> So if I call something.map!().array, I get an array of
> delegates? That makes no sense to me.
But in your example, "(a) =>" returns "{return tmp;}", which is a
delegate. Just write "(a) => tmp", or invoke the delegate by
turning it into a call: "{return tmp;}()".
More information about the Digitalmars-d-learn
mailing list