https://issues.dlang.org/show_bug.cgi?id=13877
Ketmar Dark <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Ketmar Dark <[email protected]> --- btw, with such modification both variants becomes equivalent: auto stripSave(RT) (auto ref RT rng) { static struct R { RT r; @disable void save (); alias r this; } return R(rng); } const(int)[] foo2 (in int[] data, in int i, in int max) { count2++; if (i < max) { return data.map!(n => foo2(data, i + 1, max)).stripSave.join; } else { return data; } } the code turns MapResult to non-forward range, and then join doesn't calculate everything twice. the question is: should MapResult has '.save' here in the first place? or maybe we need some API — as `stripSave` to explicitly remove features from ranges? it's very obvious to the programmer that recalculating range values is costly in this case, so he can just remove `.save` to stop Phobos using it. --
