On Wednesday, 5 October 2016 at 19:30:01 UTC, Jonathan M Davis wrote:
It doesn't even make conceptual sense for a static array to be a range, because you can't remove elements from it.

- Jonathan M Davis

Interestingly enough, I found that using .each() actually compiles without the [] but (as expected) creates a copy... So, these output different values:

  thing.each!((ref x) => writeln(&x));
  thing[].each!((ref x) => writeln(&x));

Should there me a more consistent behavior here? Even if the behavior is pretty undesired, why can the compiler consider it a range here but not .sort()?

Reply via email to