boostorg / algorithm

Boost.org algorithm module
http://boost.org/libs/algorithm
Boost Software License 1.0
114 stars 105 forks source link

Lack of bidimensional for_each #66

Closed allopislozano closed 4 years ago

allopislozano commented 4 years ago

I think it would be nice to have a way to easily apply a binary operation to two zipped ranges (or maybe a Nary operation to n zipped ranges).
It would be kind of boost::accumulate but returning void and that would not accumulate along the container dimension. Example: https://godbolt.org/z/gWFvcn

mclow commented 4 years ago

Wouldn't the existing for_each work for a zipped range (using ranges3)? The operation would have to be unary - but it would take a tuple of values.

mclow commented 4 years ago

Or using boost::range :-)

allopislozano commented 4 years ago

Hi Marshall, thank you for your answer, indeed I think that's the best solution, hadn't though about that possibility: https://godbolt.org/z/VXk6cs

by the way, I really like your talks on youtube :)