http://d.puremagic.com/issues/show_bug.cgi?id=3377
downs <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from downs <[email protected]> 2009-10-08 12:35:53 PDT --- This does compile (on 1.0): template Repeat(T, int I) { static if (!I) alias Tuple!() Repeat; else alias Tuple!(T, Repeat!(T, I - 1)) Repeat; } double unrolledDotProduct(double[] a, double[] b) { const branches = 4; assert(a.length == b.length); double result = 0; auto n = (a.length / branches) * branches; double temp[branches]; for (size_t i = 0; i != n; i += branches) { foreach (j, BOGUS; Repeat!(void, branches)) { temp[j] = a[i + j] * b[i + j]; } result += inline_sum(temp); } foreach (j; n .. a.length) { result += a[j] * b[j]; } return result; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
