Recently I needed to use a cumulative sum function, so I looked
in phobos' documentation for 'cumulative' but found nothing
useful. Then I looked in the forums for it and found nothing
useful. But when I searched phobos for it I found cumulativeFold
in std.algorithm.iteration:
https://github.com/dlang/phobos/blob/master/std/algorithm/iteration.d#L3127. So I tried this:
auto cumulativeSum(Range)(Range r)
{
import std.algorithm.iteration : cumulativeFold;
return r.cumulativeFold!((a, b) => a +b);
}
but when I run it I get 'Error: module std.algorithm.iteration
import 'cumulativeFold' not found'. Anyone can reproduce this?
looking at the source I can't see how it could possibly occur but
it is certainly a bug right?