http://d.puremagic.com/issues/show_bug.cgi?id=3098
Summary: std.algorithm.reduce example can not compile Product: D Version: 2.030 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: samhu.sa...@gmail.com CC: bugzi...@digitalmars.com Below example is from std.algorithm.reduce: double[] a = [ 3.0, 4, 7, 11, 3, 2, 5 ]; // Compute minimum and maximum in one pass auto r = reduce!(min, max)(a); // The type of r is Tuple!(double, double) assert(r.field[0] == 2); // minimum assert(r.field[1] == 11); // maximum // Compute sum and sum of squares in one pass r = reduce!("a + b", "a + b * b")(0.0, 0.0, a); assert(r.field[0]==35); assert(r.field[1]=233); Can't compile.Error msg: testFormat.d(22): Error: template std.algorithm.Reduce!("a + b","a + b * b").reduce(E,Range) does not match any function template declaration testFormat.d(22): Error: template std.algorithm.Reduce!("a + b","a + b * b").reduce(E,Range) cannot deduce template function from argument types !()(double,double,double[]) Not sure whether this is a bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------