I\'m looking through n3690
, a draft of the upcoming C++14
standard, and I see in section 7.2
paragraph 9
:
NO, there is no black-letter quote from the Standard that specifies this. The closest that one can get is point 7 of that same paragraph
7 [...] the underlying type is an integral type that can represent all the enumerator values defined in the enumeration. If no integral type can represent all the enumerator values, the enumeration is ill-formed. [...]
Furthermore, 4.5 Integral promotions [conv.prom] says
4 A prvalue of an unscoped enumeration type whose underlying type is fixed (7.2) can be converted to a prvalue of its underlying type.
As pointed out in the comments, there could be (devious IMO) implementations that have different endianess between an enum and its underlying type. That would be a Quality of Implementation issue. For all practical purposes, layout-compatibility should be expected.