
21 Dec
2012
21 Dec
'12
1:14 a.m.
on Thu Dec 20 2012, "Peter Dimov" <lists-AT-pdimov.com> wrote:
You can build three inputs over two (but not over one):
d = s + s2 + s3;
becomes
d = s + s2; d = d + s3;
It's not exactly the same, performance-wise, but the point is that two inputs are a necessary primitive, and three inputs are an optimization.
Unless you can zip, in which case only one input is needed. Most languages only have the one-sequence version of "map" (a.k.a. transform). -- Dave Abrahams BoostPro Computing Software Development Training http://www.boostpro.com Clang/LLVM/EDG Compilers C++ Boost