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

[alg.min.max] Reword min/max/minmax in modern style #6776

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

Conversation

CaseyCarter
Copy link
Contributor

@CaseyCarter CaseyCarter commented Jan 17, 2024

... to clarify the meaning of "smaller"/"smallest"/"larger"/"largest" with a custom comparison predicate and/or projection by effectively replacing those terms with code.

Closes #6747.
Closes #6752.

@CaseyCarter
Copy link
Contributor Author

This is all editorial, but probably a big enough change that LWG should sign off on it anyway.

@JohelEGP
Copy link
Contributor

This looks like a superset of #6752 to address #6747.

@CaseyCarter
Copy link
Contributor Author

CaseyCarter commented Jan 18, 2024

This doesn't exactly address #6747, which wants to replace "smaller" and "larger" with "lesser" and "greater". I want to get rid of the terms altogether and more directly explain what these algorithms do with a custom predicate and projection. In no way does std::min(4, 7, std::greater{}) return the "smaller" or "lesser" value of 4 and 7.

(But yes - thanks - the issue and PR do seem to be at least related.)

@JohelEGP
Copy link
Contributor

Right.
Since they're incompatible, I suppose you should add this to the opening comment:

Closes #6747.
Closes #6752.

source/algorithms.tex Outdated Show resolved Hide resolved
... to clarify the meaning of "smaller"/"smallest"/"larger"/"largest" with a custom comparison predicate and/or projection.
@@ -8724,19 +8724,20 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
Let \tcode{comp} be \tcode{less\{\}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether this part is editorial for legacy std versions. Since less{} is more determinate than the built-in operation when the comparison between pointers is involved.

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.

Replace "smaller" with "lower" and "larger" with "greater"?
4 participants