On Saturday, 6 February 2016 at 15:02:16 UTC, H. S. Teoh wrote:
Not really sure, but opIndex() with no arguments is supposed to be the current way of implement the [] slicing operator for user-defined types. I'm not sure when foreach started supporting that, but it's certainly a nice thing!T
It feels a little weird because none of the range functions like map support calling opIndex so you can omit the [] in foreach but not with map. Just feels inconsistent.