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, numerics] Replace "exactly" with "at most" in Complexity #7364

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

Conversation

frederick-vs-ja
Copy link
Contributor

Fixes #5636.

Per the discussion in that issue, I think this can be editorial. Although it seems to me that some "exactly" are actually exact.

@jensmaurer
Copy link
Member

@jwakely ?

@jwakely
Copy link
Member

jwakely commented Mar 18, 2025

This doesn't seem like an improvement. Do we want implementations to be allowed to perform fewer than last - first applications for for_each, as an optimization? Or to perform fewer than last - first assignments for std::copy?

If that's allowed, I can make my implementation much faster.

@jwakely
Copy link
Member

jwakely commented Mar 18, 2025

I agree that for some cases like ranges::shuffle "exactly" isn't helpful, but I don't see why we'd want to remove "exactly" from for_each, copy, etc.

Is the concern that an exception could cause the loop to finish early? Because I don't think we care about that for the Complexity elements.

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.

[alg.random.shuffle] ranges::shuffle - "exactly" or "at most" for number of swaps?
3 participants