A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4140/expr.eq below:

[expr.eq]

5.10 Equality operators [expr.eq]
equality-expression:
    relational-expression
    equality-expression == relational-expression
    equality-expression != relational-expression

The == (equal to) and the != (not equal to) operators group left-to-right. The operands shall have arithmetic, enumeration, pointer, or pointer to member type, or type std::nullptr_t. The operators == and != both yield true or false, i.e., a result of type bool. In each case below, the operands shall have the same type after the specified conversions have been applied.

If at least one of the operands is a pointer, pointer conversions ([conv.ptr]) and qualification conversions ([conv.qual]) are performed on both operands to bring them to their composite pointer type (Clause [expr]). Comparing pointers is defined as follows: Two pointers compare equal if they are both null, both point to the same function, or both represent the same address ([basic.compound]), otherwise they compare unequal.

If at least one of the operands is a pointer to member, pointer to member conversions ([conv.mem]) and qualification conversions ([conv.qual]) are performed on both operands to bring them to their composite pointer type (Clause [expr]). Comparing pointers to members is defined as follows:

Two operands of type std::nullptr_t or one operand of type std::nullptr_t and the other a null pointer constant compare equal.

If two operands compare equal, the result is true for the == operator and false for the != operator. If two operands compare unequal, the result is false for the == operator and true for the != operator. Otherwise, the result of each of the operators is unspecified.

If both operands are of arithmetic or enumeration type, the usual arithmetic conversions are performed on both operands; each of the operators shall yield true if the specified relationship is true and false if it is false.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4