7 Expressions [expr]

7.6 Compound expressions [expr.compound]

7.6.9 Relational operators [expr.rel]

The relational operators group left-to-right.
Example
:
a<b<c means (a<b)<c and not (a<b)&&(b<c).
— end example
 ]
The comparison is deprecated if both operands were of array type prior to these conversions ([depr.array.comp]).
The converted operands shall have arithmetic, enumeration, or pointer type.
The operators < (less than), > (greater than), <= (less than or equal to), and >= (greater than or equal to) all yield false or true.
The type of the result is bool.
The usual arithmetic conversions are performed on operands of arithmetic or enumeration type.
If both operands are pointers, pointer conversions and qualification conversions are performed to bring them to their composite pointer type.
After conversions, the operands shall have the same type.
The result of comparing unequal pointers to objects77 is defined in terms of a partial order consistent with the following rules:
If two operands p and q compare equal, p<=q and p>=q both yield true and p<q and p>q both yield false.
Otherwise, if a pointer p compares greater than a pointer q, p>=q, p>q, q<=p, and q<p all yield true and p<=q, p<q, q>=p, and q>p all yield false.
Otherwise, the result of each of the operators is unspecified.
If both operands (after conversions) are of arithmetic or enumeration type, each of the operators shall yield true if the specified relationship is true and false if it is false.
As specified in [basic.compound], an object that is not an array element is considered to belong to a single-element array for this purpose and a pointer past the last element of an array of n elements is considered to be equivalent to a pointer to a hypothetical array element n for this purpose.