[Issue 4725] std.algorithm.sum()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 15 08:17:25 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=4725



--- Comment #7 from Andrei Alexandrescu <andrei at metalanguage.com> 2011-05-15 08:13:20 PDT ---
Hm, I don't get why we should start from scratch instead of reusing reduce.

auto sum(R)(R range)
if(is(typeof(ElementType!(R).init + ElementType!(R).init)))
{
    return reduce!"a + b"(0, range);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list