Turn .opApply into ranges

Yuxuan Shui via Digitalmars-d digitalmars-d at puremagic.com
Tue May 9 10:23:36 PDT 2017


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?


More information about the Digitalmars-d mailing list