[Issue 15722] std.algorithm sum should favour speed

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Feb 25 05:40:21 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15722

--- Comment #2 from adamsibson at hotmail.com ---
(In reply to Cédric Picard from comment #1)
> I would rather have a comment in the doc saying "Pairwise summation is
> slower than naive one, for performance use reduce!((a, b) => a+b)", adding a
> new function for that seems overkill.

Why? There seems to be a strong resistance to convenience functions in the
library, one that is unnecessary. There is a significant difference between
arr.sum and arr.reduce!((a, b) => a + b) in usability. In writing this post I
initially forgot I have do put a, b in an additional set of brackets, it's
complicated and not particularly user-friendly.

--


More information about the Digitalmars-d-bugs mailing list