Native enums in C++

I always thought that enums in C++ always had the same integer as the underlying type. I discovered today that need not be the case and they can have any integral type as an underlying type. See the example below as an example.