No trace of cumulativeFold except in the source.
    e-y-e via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Sun Oct 23 00:46:19 PDT 2016
    
    
  
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?
    
    
More information about the Digitalmars-d-learn
mailing list