From Jason Turner

[expr.eq]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpx2taq7ib/{from.md → to.md} +25 -13
tmp/tmpx2taq7ib/{from.md → to.md} RENAMED
@@ -6,31 +6,30 @@ equality-expression:
6
  equality-expression '==' relational-expression
7
  equality-expression '!=' relational-expression
8
  ```
9
 
10
  The `==` (equal to) and the `!=` (not equal to) operators group
11
- left-to-right. The lvalue-to-rvalue [[conv.lval]], array-to-pointer
12
- [[conv.array]], and function-to-pointer [[conv.func]] standard
13
- conversions are performed on the operands. The comparison is deprecated
14
- if both operands were of array type prior to these conversions
15
- [[depr.array.comp]].
16
 
17
- The converted operands shall have arithmetic, enumeration, pointer, or
18
- pointer-to-member type, or type `std::nullptr_t`. The operators `==` and
19
  `!=` both yield `true` or `false`, i.e., a result of type `bool`. In
20
  each case below, the operands shall have the same type after the
21
  specified conversions have been applied.
22
 
23
- If at least one of the operands is a pointer, pointer conversions
24
- [[conv.ptr]], function pointer conversions [[conv.fctptr]], and
25
- qualification conversions [[conv.qual]] are performed on both operands
26
- to bring them to their composite pointer type [[expr.type]]. Comparing
27
- pointers is defined as follows:
28
 
29
  - If one pointer represents the address of a complete object, and
30
  another pointer represents the address one past the last element of a
31
- different complete object,[^31] the result of the comparison is
32
  unspecified.
33
  - Otherwise, if the pointers are both null, both point to the same
34
  function, or both represent the same address [[basic.compound]], they
35
  compare equal.
36
  - Otherwise, the pointers compare unequal.
@@ -90,10 +89,23 @@ performed on both operands to bring them to their composite pointer type
90
  — *end example*]
91
 
92
  Two operands of type `std::nullptr_t` or one operand of type
93
  `std::nullptr_t` and the other a null pointer constant compare equal.
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  If two operands compare equal, the result is `true` for the `==`
96
  operator and `false` for the `!=` operator. If two operands compare
97
  unequal, the result is `false` for the `==` operator and `true` for the
98
  `!=` operator. Otherwise, the result of each of the operators is
99
  unspecified.
 
6
  equality-expression '==' relational-expression
7
  equality-expression '!=' relational-expression
8
  ```
9
 
10
  The `==` (equal to) and the `!=` (not equal to) operators group
11
+ left-to-right. The lvalue-to-rvalue [[conv.lval]] and
12
+ function-to-pointer [[conv.func]] standard conversions are performed on
13
+ the operands. If one of the operands is a pointer or a null pointer
14
+ constant [[conv.ptr]], the array-to-pointer conversion [[conv.array]] is
15
+ performed on the other operand.
16
 
17
+ The converted operands shall have scalar type. The operators `==` and
 
18
  `!=` both yield `true` or `false`, i.e., a result of type `bool`. In
19
  each case below, the operands shall have the same type after the
20
  specified conversions have been applied.
21
 
22
+ If at least one of the converted operands is a pointer, pointer
23
+ conversions [[conv.ptr]], function pointer conversions [[conv.fctptr]],
24
+ and qualification conversions [[conv.qual]] are performed on both
25
+ operands to bring them to their composite pointer type [[expr.type]].
26
+ Comparing pointers is defined as follows:
27
 
28
  - If one pointer represents the address of a complete object, and
29
  another pointer represents the address one past the last element of a
30
+ different complete object,[^28] the result of the comparison is
31
  unspecified.
32
  - Otherwise, if the pointers are both null, both point to the same
33
  function, or both represent the same address [[basic.compound]], they
34
  compare equal.
35
  - Otherwise, the pointers compare unequal.
 
89
  — *end example*]
90
 
91
  Two operands of type `std::nullptr_t` or one operand of type
92
  `std::nullptr_t` and the other a null pointer constant compare equal.
93
 
94
+ If both operands are of type `std::meta::info`, they compare equal if
95
+ both operands
96
+
97
+ - are null reflection values,
98
+ - represent values that are template-argument-equivalent [[temp.type]],
99
+ - represent the same object,
100
+ - represent the same entity,
101
+ - represent the same annotation [[dcl.attr.annotation]],
102
+ - represent the same direct base class relationship, or
103
+ - represent equal data member descriptions [[class.mem.general]],
104
+
105
+ and they compare unequal otherwise.
106
+
107
  If two operands compare equal, the result is `true` for the `==`
108
  operator and `false` for the `!=` operator. If two operands compare
109
  unequal, the result is `false` for the `==` operator and `true` for the
110
  `!=` operator. Otherwise, the result of each of the operators is
111
  unspecified.