|
474 | 474 | \end{itemize}
|
475 | 475 | \end{itemize}
|
476 | 476 |
|
| 477 | +\pnum |
| 478 | +If one operand is of enumeration type |
| 479 | +and the other operand is of |
| 480 | +a different enumeration type or |
| 481 | +a floating-point type, |
| 482 | +this behavior is deprecated\iref{depr.arith.conv.enum}. |
| 483 | + |
477 | 484 | \rSec1[expr.prim]{Primary expressions}%
|
478 | 485 | \indextext{expression!primary|(}
|
479 | 486 |
|
|
4964 | 4971 |
|
4965 | 4972 | \pnum
|
4966 | 4973 | If both operands have arithmetic types,
|
| 4974 | +or one operand has integral type and |
| 4975 | +the other operand has unscoped enumeration type, |
4967 | 4976 | the usual arithmetic conversions\iref{expr.arith.conv} are applied to the operands.
|
4968 | 4977 | Then:
|
4969 | 4978 |
|
|
5092 | 5101 | \tcode{a<b<c} means \tcode{(a<b)<c} and \emph{not}
|
5093 | 5102 | \tcode{(a<b)\&\&(b<c)}.
|
5094 | 5103 | \end{example}
|
5095 |
| - |
| 5104 | +% |
5096 | 5105 | \indextext{operator!less than}%
|
5097 | 5106 | \indextext{\idxcode{<}|see{operator, less than}}%
|
5098 | 5107 | \indextext{operator!greater than}%
|
|
5110 | 5119 | relational-expression \terminal{<=} compare-expression\br
|
5111 | 5120 | relational-expression \terminal{>=} compare-expression
|
5112 | 5121 | \end{bnf}
|
| 5122 | +% |
| 5123 | +The |
| 5124 | +lvalue-to-rvalue\iref{conv.lval}, |
| 5125 | +array-to-pointer\iref{conv.array}, |
| 5126 | +and function-to-pointer\iref{conv.func} |
| 5127 | +standard conversions are performed on the operands. |
| 5128 | +The comparison is deprecated if |
| 5129 | +both operands were of array type |
| 5130 | +prior to these conversions\iref{depr.array.comp}. |
5113 | 5131 |
|
5114 |
| -The operands shall have arithmetic, enumeration, or pointer type. The |
| 5132 | +\pnum |
| 5133 | +The converted operands shall have arithmetic, enumeration, or pointer type. |
| 5134 | +The |
5115 | 5135 | operators \tcode{<} (less than), \tcode{>} (greater than), \tcode{<=}
|
5116 | 5136 | (less than or equal to), and \tcode{>=} (greater than or equal to) all
|
5117 | 5137 | yield \tcode{false} or \tcode{true}. The type of the result is
|
|
5178 | 5198 |
|
5179 | 5199 | \pnum
|
5180 | 5200 | The \tcode{==} (equal to) and the \tcode{!=} (not equal to) operators
|
5181 |
| -group left-to-right. The operands shall have arithmetic, enumeration, pointer, |
| 5201 | +group left-to-right. |
| 5202 | +The |
| 5203 | +lvalue-to-rvalue\iref{conv.lval}, |
| 5204 | +array-to-pointer\iref{conv.array}, |
| 5205 | +and function-to-pointer\iref{conv.func} |
| 5206 | +standard conversions are performed on the operands. |
| 5207 | +The comparison is deprecated if |
| 5208 | +both operands were of array type |
| 5209 | +prior to these conversions\iref{depr.array.comp}. |
| 5210 | + |
| 5211 | +\pnum |
| 5212 | +The converted operands shall have arithmetic, enumeration, pointer, |
5182 | 5213 | or pointer-to-member type, or type \tcode{std::nullptr_t}. The operators
|
5183 | 5214 | \tcode{==} and \tcode{!=} both yield \tcode{true} or \tcode{false}, i.e., a
|
5184 | 5215 | result of type \tcode{bool}. In each case below, the operands shall have the
|
|
0 commit comments