https://issues.dlang.org/show_bug.cgi?id=12655
--- Comment #3 from [email protected] --- A cumulate returning the same number elements can be written using map. auto cumulate(alias f, R, T)(R r, T seed) if (isInputRange!R && is(T == ElementType!R)) { import std.algorithm : map; return r.map!(a => a = seed = f(seed, a)); } I leave this here for reference and others to decide whether such a function should be added to Phobos. --
