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

[algorithms] reorders the fold family #6735

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

cjdb
Copy link
Contributor

@cjdb cjdb commented Dec 14, 2023

I accidentally mixed up fold_left_with_iter with other fold algorithms multiple times while implementing it for libc++, and it might also be confusing reviewrs. This commit reorders them so that they appear in an order that they might be implemented.

  • fold_left_with_iter
  • fold_left
  • fold_left_first_with_iter
  • fold_left_first
  • fold_right
  • fold_right_last

I accidentally mixed up `fold_left_with_iter` with other fold algorithms
multiple times while implementing it for libc++, and it might also be
confusing reviewrs. This commit reorders them so that they appear in an
order that they might be implemented.

* `fold_left_with_iter`
* `fold_left`
* `fold_left_first_with_iter`
* `fold_left_first`
* `fold_right`
* `fold_right_last`
Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not seeing that "while implementing it" is a convincing argument for any presentation order.

In general, the "simpler" algorithms are presented first, I think, and those with more extensive/complicated parameters or return types later. That argues for moving the "with_iter" stuff to immediately before fold_right, but not any further up.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Dec 14, 2023
@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision-required A decision of the editorial group (or the Project Editor) is required. needs rebase The pull request needs a git rebase to resolve merge conflicts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants