Can I determine the type that will be used as the base enumeration type? Something like that:
struct S { S(int i) : value(i) {} operator int() { return value; } int value; }; enum E : S { A, B, C };
The error message reports that S must be an integral type. I tried to specialize std::is_integral as follows, but it seems that in this context the "integral type" really means one of the main types.
namespace std { template<> struct is_integral<S> : public true_type {}; }
So, using any version of C ++, is there a way to make a custom type disconnected as an integral type?
source share