-
Notifications
You must be signed in to change notification settings - Fork 990
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
Use std::min replace min #1783
Use std::min replace min #1783
Conversation
aa17e90
to
38ec9eb
Compare
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.
The PR looks mostly fine, but I'm unclear to the motivation. You mention "cross-platform", but how does this change improve that?
d5da453
to
8dca051
Compare
1d0762c
to
86fdd25
Compare
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.
I think the code looks good now. But I'm still not clear on the rationale. What was the reason you started working on this fix?
- There are standard functions available, so why define them yourself?
- I am will use to msvc.
|
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.
- There are standard functions available, so why define them yourself?
Generally, that's a good principle. But std::min()
has some bad behaviours based on the fact that it is implemented as a template, which means it isn't always a good fit.
We also don't want to avoid creating unnecessary history, as that makes git blame
annoying to use. In other words, there should be a decently sized cleanup.
That said, this didn't change too many lines. So I can accept this if it makes things easier for you.
- I am will use to msvc.
Ah. That's not one of our normally used compilers, but it's always a plus if we're more compatible.
Please describe any bad behaviours? |
Use std::min replace min