Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dual-sequence overloads to transform_inclusive_scan() and transform_exclusive_scan() #104

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

jgopel
Copy link
Contributor

@jgopel jgopel commented Jun 6, 2022

There are dual-sequence overloads for transform() (this overload is called zip in may other languages) and transform_reduce(), in the standard, but there is no similar version for transform_inclusive_scan() or transform_exclusive_scan(). This patch-set also adds constexpr support to the existing overloads.

h/t to @elbeno for suggesting implementing this.

jgopel added 4 commits June 6, 2022 00:33
Problem:
- C++20 added `constexpr` to `transform_inclusive_scan()`. The existing
  implementations could be `constexpr` but were not updated.

Solution:
- Add `constexpr`.
Problem:
- `transform()` has an overload that takes two input sequences - in
  other languages this is called `zip()`.
- `transform_reduce()` has an overload that takes two input sequences.
- `transform_inclusive_scan()` does not have this overload, despite its
  obvious utility from the other cases.

Solution:
- Implement an overload of `transform_inclusive_scan()` that takes two
  input sequences.
Problem:
- C++20 added `constexpr` to `transform_exclusive_scan()`. The existing
  implementation could be `constexpr` but was not updated.

Solution:
- Add `constexpr`.
Problem:
- `transform()` has an overload that takes two input sequences - in
  other languages this is called `zip()`.
- `transform_reduce()` has an overload that takes two input sequences.
- `transform_inclusive_scan()` has an overload that takes two input
  sequences.
- `transform_exclusive_scan()` does not have this overload, despite its
  obvious utility from the other cases.

Solution:
- Implement an overload of `transform_exclusive_scan()` that takes two
  input ranges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant