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

refactor: Refactored all of randomElement related functions and iterators to use ranges instead #843

Merged
merged 4 commits into from
Aug 3, 2024

Conversation

eric-bodhi
Copy link
Contributor

With all of these functions using ranges instead of iterators, all you have to do is just pass the container straight since these cover all overloads.

Instead of using a pair of iterators you can use ranges::subrange(start, end) instead etc
These algos are also a lot more optimized and follow the best practices.

The first algo which is multipass is specifically for random_accsess and forward / sized ranges. Every other type of range that is basic like input_range uses a single pass approach.

@eric-bodhi eric-bodhi closed this Aug 3, 2024
@eric-bodhi eric-bodhi reopened this Aug 3, 2024
@cieslarmichal cieslarmichal linked an issue Aug 3, 2024 that may be closed by this pull request
@cieslarmichal cieslarmichal merged commit 723e362 into cieslarmichal:main Aug 3, 2024
28 of 29 checks passed
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.

Refactor All Iterator Functions to use Ranges
2 participants