-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement ranges::sample and ranges::shuffle #1052
Conversation
Thanks for the initial review, @statementreply! 😸 Moving to WIP as you've identified the cause of (at least one of) the test failures (mentioning a nonexistent |
Co-authored-by: statementreply <[email protected]>
It seems activating the tests actually helps... |
Co-authored-by: statementreply <[email protected]>
Given that we move the concept definition into algorithm I have put the ranges::shuffle implementation into this PR as otherwise merging is a hassle and both are similar anyway |
Tests are active and passing so this should be ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nitpick which I'll go ahead and apply.
Avoid contextually converting integer to bool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good modulo comments, thanks!
Thanks for implementing these algorithms, whose choice I suspect was actually quite deliberate - not random at all. |
Co-authored-by: statementreply <[email protected]>
This ports the sampling algorithm to ranges.
I am unsure what exactly the problem is with the tests. I guess somecombinations of the machinery do not play well with the requirements but I have to figure out which.