
20 Dec
2012
20 Dec
'12
11:36 p.m.
Mathias Gaunard wrote:
I had forgotten there was a variant of std::transform with two inputs too.
But then there is not one for three inputs or more. The only way you have to use an arbitrary amount of inputs is to use a zip_iterator
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.