With a declaration such as:
enum DrawBoldMode : unsigned
{
DBM_NONE = 0,
DBM_ITEM = 1<<0, // bold just the nearest line
DBM_SECTION = 1<<1, // bold all lines in the same section
DBM_LINETYPE = 1<<2, // bold all lines of the same line type
DBM_POINTAGE = 1<<3, // bold all lines of the same line type
};
How can I derive the underlying type of DrawBoldMode (i.e. unsigned)?
It should be available as
std::underlying_type<DrawBoldMode>::type. However, my compiler (GCC 4.6.1) doesn’t seem to implement that.I think it’s impossible to implement it with templates, but I could be wrong about that.