What happens if an enum cannot fit into an integral type?
问题 I came across this question about the underlying types of enums, where an answers quotes Standard C++ 7.2/5 as: The underlying type of an enumeration is an integral type that can represent all the enumerator values defined in the enumeration. It is implementation-defined which integral type is used as the underlying type for an enumeration except that the underlying type shall not be larger than int unless the value of an enu- merator cannot fit in an int or unsigned int. This is pretty clear