Affected subclause: [expr.arith.conv]
Change: Operations mixing a value of an enumeration type and a value of a different
enumeration type or of a floating-point type are not valid
. For example:
enum E1 { e };
enum E2 { f };
int b = e <= 3.7;
int k = f - e;
int x = 1 ? e : f;
Rationale: Reinforcing type safety in C++
. Effect on original feature: Well-formed C code will not compile with this International Standard
. Difficulty of converting: Violations will be diagnosed by the C++ translator
. The original behavior can be restored with a cast or integral promotion
. For example:
enum E1 { e };
enum E2 { f };
int b = (int)e <= 3.7;
int k = +f - e;
How widely used: Uncommon
.