tcbrindle / flux

A C++20 library for sequence-orientated programming
https://tristanbrindle.com/flux/
Boost Software License 1.0
484 stars 29 forks source link

Add zip_map adaptor #184

Closed isaacy2012 closed 2 months ago

isaacy2012 commented 5 months ago

Addresses, #172: The element type of flux::cartesian_product, cartesian_power and adjacent is a tuple of the element type(s) of the underlying sequences. These three adaptors also provide *_map versions, which take an n-ary function and call it directly with the underlying elements. This is to avoid forming a tuple and then immediately destructuring it, as would happen in a subsequent call to map(unpack(func)).

This commit adds the *_map version for the zip adaptor.

tcbrindle commented 2 months ago

So first of all, please accept my apologies @isaacy2012 for letting this PR languish for months. I'm afraid I was pretty busy at the time you originally submitted it so I intended to review it later, and then I somehow I never got back to looking at it. I feel very bad!

The good news is that this PR looks great! I've just got a couple of small comments but otherwise this looks awesome.

If you've moved on in the intervening time and don't feel like coming back to this then I quite understand :). I'll be happy to do a final polish if you're busy with other things.

Thanks, and apologies again

isaacy2012 commented 2 months ago

Hi @tcbrindle, no worries at all, I'll address those changes this weekend :)

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.22%. Comparing base (d7bbf7c) to head (6cefba1).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #184 +/- ## ======================================= Coverage 98.22% 98.22% ======================================= Files 69 69 Lines 2360 2360 ======================================= Hits 2318 2318 Misses 42 42 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tcbrindle commented 2 months ago

Thanks @isaacy2012!