14.9.5 Enumeration comparison operators
来源:互联网 发布:互联网商业模式知乎 编辑:程序博客网 时间:2024/06/05 00:11
Every enumeration type implicitly provides the following predefined
comparison operators:
bool operator ==(E x, E y);
bool operator !=(E x, E y);
bool operator <(E x, E y);
bool operator >(E x, E y);
bool operator <=(E x, E y);
bool operator >=(E x, E y);
The result of evaluating x op y, where x and y are expressions of an
enumeration type E with an underlying
type U, and op is one of the comparison operators, is exactly the same as
evaluating ((U)x) op ((U)y). In
other words, the enumeration type comparison operators simply compare the
underlying integral values of
the two operands.
comparison operators:
bool operator ==(E x, E y);
bool operator !=(E x, E y);
bool operator <(E x, E y);
bool operator >(E x, E y);
bool operator <=(E x, E y);
bool operator >=(E x, E y);
The result of evaluating x op y, where x and y are expressions of an
enumeration type E with an underlying
type U, and op is one of the comparison operators, is exactly the same as
evaluating ((U)x) op ((U)y). In
other words, the enumeration type comparison operators simply compare the
underlying integral values of
the two operands.
- 14.9.5 Enumeration comparison operators
- 14.9.1 Integer comparison operators
- 14.9.3 Decimal comparison operators
- 14.9.2 Floating-point comparison operators
- Bash Commands - Comparison Operators
- How to override comparison operators in Python
- Smallest of three integers without comparison operators
- Compare two ints without using comparison operators
- Enumeration
- Enumeration
- enumeration
- Enumeration
- Enumeration
- Enumeration
- Enumeration
- Enumeration
- Enumeration
- Enumeration
- 14.9 Relational & type-testing operators
- 14.9.1 Integer comparison operators
- 14.9.2 Floating-point comparison operators
- 14.9.3 Decimal comparison operators
- 14.9.4 Boolean equality operators
- 14.9.5 Enumeration comparison operators
- 14.9.6 Reference type equality operators
- 14.9.7 String equality operators
- 14.9.8 Delegate equality operators
- 14.9.9 The is operator
- 14.9.10 The as operator
- 14.10 Logical operators
- 14.11 Conditional logical operators
- 当Spring遇到Ruby