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

missing definition for "comparison operator" #3284

Closed
zygoloid opened this issue Oct 9, 2019 · 0 comments · Fixed by #3285
Closed

missing definition for "comparison operator" #3284

zygoloid opened this issue Oct 9, 2019 · 0 comments · Fixed by #3285
Assignees

Comments

@zygoloid
Copy link
Member

zygoloid commented Oct 9, 2019

In [dcl.fct.def.default]/1.1, we find that an explicitly-defaulted function shall

be a special member function or a comparison operator (7.6.8, 7.6.9, 7.6.10)

but what is a "comparison operator"? The cross-references point to some [expr] subsections that have pretty much nothing to do with it. (Those are the places where we don't go when there is a comparison operator to use!)

Similarly [class.compare.default] talks about "A defaulted comparison operator function" with the same list of irrelevant cross-references, and likewise in [except.spec]p11.

We should add a definition of "comparison operator" as one of the seven intended overloaded operator functions (operator<, operator<=, operator>, operator<=, operator==, operator!=, operator<=>), probably in [over.binary], and change all the above cross-references to point at that instead. I think the existing list of cross-references is sufficiently suggestive that this can be done editorially.

While we're here, we should consider renaming the term from "comparison operator" to "comparison function", matching "conversion function" and clarifying that we mean the function case and not the built-in operator case.

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 a pull request may close this issue.

2 participants