Re: reduce a BitArray[]

2015-12-29 Thread Alex Parrill via Digitalmars-d-learn
n.d(2477): instantiated from here: staticMap!(ReduceSeedType, __lambda1) /d486/f868.d(16): instantiated from here: reduce!(BitArray[]) /d486/f868.d(16): Error: template std.algorithm.iteration.reduce cannot deduce function from argument types !((a, b) => a & b)(BitArray[]

Re: reduce a BitArray[]

2015-12-29 Thread Daniel Kozak via Digitalmars-d-learn
iteration.d(2570): > Error: variable f868.main.F!(__lambda1).e cannot be declared to > be a function > /opt/compilers/dmd2/include/std/meta.d(546): Error: template > instance f868.main.F!(__lambda1) error instantiating > /opt/compilers/dmd2/include/std/algorithm/iteration.d

reduce a BitArray[]

2015-12-29 Thread Alex via Digitalmars-d-learn
Hi there, a silly question from me for the turn of the year... I apparently missing the forest through the trees. The first part of the code works as expected: [code] int[] arr8 = [1,2,3,4,5]; int sum = 0; foreach(int summand; arr8) { sum += summand; }