May 09, 2017 Turn .opApply into ranges | ||||
---|---|---|---|---|
| ||||
I wondered if I can turn struct that defines opApply into ranges. And it turns out to be surprisingly easy: https://gist.github.com/yshui/716cfe987c89997760cabc2c951ca430 Maybe we can phase out opApply support in foreach? ;) BTW, is there a way to get the "element type" from .opApply? |
May 09, 2017 Re: Turn .opApply into ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to Yuxuan Shui | On Tuesday, 9 May 2017 at 17:23:36 UTC, Yuxuan Shui wrote:
> I wondered if I can turn struct that defines opApply into ranges.
>
> And it turns out to be surprisingly easy:
>
> https://gist.github.com/yshui/716cfe987c89997760cabc2c951ca430
>
> Maybe we can phase out opApply support in foreach? ;)
>
> BTW, is there a way to get the "element type" from .opApply?
This "conversion" relies on fibers which need heavy runtime support.
So no, opApply still has it's place.
|
Copyright © 1999-2021 by the D Language Foundation