tmp/tmpnp8lkp0a/{from.md → to.md}
RENAMED
|
@@ -29,30 +29,36 @@ operands of arithmetic or enumeration type. If both operands are
|
|
| 29 |
pointers, pointer conversions [[conv.ptr]] and qualification conversions
|
| 30 |
[[conv.qual]] are performed to bring them to their composite pointer
|
| 31 |
type [[expr.type]]. After conversions, the operands shall have the same
|
| 32 |
type.
|
| 33 |
|
| 34 |
-
The result of comparing unequal pointers to objects
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
|
| 37 |
- If two pointers point to different elements of the same array, or to
|
| 38 |
subobjects thereof, the pointer to the element with the higher
|
| 39 |
subscript is required to compare greater.
|
| 40 |
- If two pointers point to different non-static data members of the same
|
| 41 |
object, or to subobjects of such members, recursively, the pointer to
|
| 42 |
-
the later declared member is required to compare greater provided
|
| 43 |
-
|
| 44 |
-
|
| 45 |
- Otherwise, neither pointer is required to compare greater than the
|
| 46 |
other.
|
| 47 |
|
| 48 |
If two operands `p` and `q` compare equal [[expr.eq]], `p<=q` and `p>=q`
|
| 49 |
both yield `true` and `p<q` and `p>q` both yield `false`. Otherwise, if
|
| 50 |
-
a pointer `p` compares greater than a pointer `q`, `p>=q`,
|
| 51 |
-
`q<=p`, and `q<p` all yield `true` and `p<=q`, `p<q`, `q>=p`, and
|
| 52 |
-
all yield `false`. Otherwise, the result of each of the operators
|
| 53 |
-
unspecified.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
If both operands (after conversions) are of arithmetic or enumeration
|
| 56 |
type, each of the operators shall yield `true` if the specified
|
| 57 |
relationship is true and `false` if it is false.
|
| 58 |
|
|
|
|
| 29 |
pointers, pointer conversions [[conv.ptr]] and qualification conversions
|
| 30 |
[[conv.qual]] are performed to bring them to their composite pointer
|
| 31 |
type [[expr.type]]. After conversions, the operands shall have the same
|
| 32 |
type.
|
| 33 |
|
| 34 |
+
The result of comparing unequal pointers to objects[^30]
|
| 35 |
+
|
| 36 |
+
is defined in terms of a partial order consistent with the following
|
| 37 |
+
rules:
|
| 38 |
|
| 39 |
- If two pointers point to different elements of the same array, or to
|
| 40 |
subobjects thereof, the pointer to the element with the higher
|
| 41 |
subscript is required to compare greater.
|
| 42 |
- If two pointers point to different non-static data members of the same
|
| 43 |
object, or to subobjects of such members, recursively, the pointer to
|
| 44 |
+
the later declared member is required to compare greater provided
|
| 45 |
+
neither member is a subobject of zero size and their class is not a
|
| 46 |
+
union.
|
| 47 |
- Otherwise, neither pointer is required to compare greater than the
|
| 48 |
other.
|
| 49 |
|
| 50 |
If two operands `p` and `q` compare equal [[expr.eq]], `p<=q` and `p>=q`
|
| 51 |
both yield `true` and `p<q` and `p>q` both yield `false`. Otherwise, if
|
| 52 |
+
a pointer to object `p` compares greater than a pointer `q`, `p>=q`,
|
| 53 |
+
`p>q`, `q<=p`, and `q<p` all yield `true` and `p<=q`, `p<q`, `q>=p`, and
|
| 54 |
+
`q>p` all yield `false`. Otherwise, the result of each of the operators
|
| 55 |
+
is unspecified.
|
| 56 |
+
|
| 57 |
+
[*Note 1*: A relational operator applied to unequal function pointers
|
| 58 |
+
or to unequal pointers to `void` yields an unspecified
|
| 59 |
+
result. — *end note*]
|
| 60 |
|
| 61 |
If both operands (after conversions) are of arithmetic or enumeration
|
| 62 |
type, each of the operators shall yield `true` if the specified
|
| 63 |
relationship is true and `false` if it is false.
|
| 64 |
|