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 min/max to std #4781

Closed
aajj999 opened this issue Apr 11, 2024 · 0 comments · Fixed by #4839
Closed

Add min/max to std #4781

aajj999 opened this issue Apr 11, 2024 · 0 comments · Fixed by #4839
Labels
enhancement New feature or request

Comments

@aajj999
Copy link

aajj999 commented Apr 11, 2024

Problem

Most of modern programming languages includes these functions by default.
Bonus points if it preserves comptimeness of the value and allows to use the result as a loop bound.

Happy Case

It's there.

Project Impact

Nice-to-have

Impact Context

No response

Workaround

Yes

Workaround Description

Write your own.

Additional Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@aajj999 aajj999 added the enhancement New feature or request label Apr 11, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 19, 2024
# Description

## Problem\*

Resolves #4781

## Summary\*

This PR adds an equivalent to Rust's `std::cmp:max` and `std::cmp::min`
https://doc.rust-lang.org/src/core/cmp.rs.html#1209

## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant