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

Simplifying [class.rel] wording. #2780

Merged
merged 3 commits into from Mar 15, 2019

Conversation

brevzin
Copy link
Contributor

@brevzin brevzin commented Mar 14, 2019

x and y have the same type (this is in the context of a defaulted relational operator, so they have to be per [class.compare]/1). So either x <=> y finds something or it doesn't - there's no situation where we'd select the reversed candidate y <=> x, so we can simplify this wording. Same thing Richard pointed out http://lists.isocpp.org/core/2019/03/5706.php about defaulted !=.

Also, we never changed that x <=> y @ 0 is actually convertible to bool, so added that too.

results in an ambiguity
or a function that is deleted or inaccessible from the operator function,
or

\item
the operator \tcode{@}
cannot be applied to the return type of \tcode{x <=> y} or \tcode{y <=> x}.
\tcode{x <=> y @ 0} is ill-formed.
Copy link
Member

Choose a reason for hiding this comment

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

This fully covers the check in the first bullet, but it also covers some other things (overload resolution can succeed and pick a function that is nonetheless not callable). As such, changing to this wording is also non-editorial. =(

I think we should just drop the "or y <=> x" from this bullet for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Core issue it is then 😃

@zygoloid zygoloid added the changes requested Changes to the wording or approach have been requested and not yet applied. label Mar 15, 2019
@jensmaurer jensmaurer removed the changes requested Changes to the wording or approach have been requested and not yet applied. label Mar 15, 2019
@jensmaurer
Copy link
Member

Changes have been applied; commits need squashing.

@brevzin
Copy link
Contributor Author

brevzin commented Mar 15, 2019

As in... you want me to force push? Why not squash merge?

@zygoloid zygoloid merged commit 54ddcb9 into cplusplus:master Mar 15, 2019
@zygoloid
Copy link
Member

I imagine Jens' comment was a reminder to me to squash rather than just rebasing.

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.

None yet

3 participants