Skip to content

[expr.rel] "compares greater" term is needlessly confusing #1938

@zygoloid

Description

@zygoloid

In [expr.rell]p3, we implicitly introduce a relation called "compares greater". However, it's confusing to use this term, since there are other cases that might /also/ compare greater in the colloquial sense, if they fall into the ~(p compares greater than q) /\ ~(p compares greater than p) case. It's also easy to misread p3 as actually specifying the result of the comparison operators rather than just defining an intermediate term.

How about:

  1. Changing the introductory sentence to "The result of comparing unequal pointers to elements is specified in terms of a "definitely compares greater" relation, defined as follows:"
  2. Replace "compares greater" with "definitely compares greater" throughout.

Likewise in [expr.eq]p2 and p3 we should make it clear that we're just defining a "compares equal" relation, not actually defining the result of the operators. This is confounded by p3.3 and p3.4 actually trying to define the result of the the operators ("the result is unspecified"). As per the [expr.rel] changes, we should change the introductory sentence to clarify this, rename the relations to "definitely compare equal" and "definitely compare unequal", and change the "the result is unspecified" to "neither definitely compare equal nor definitely compare unequal".

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions