No, it’s not possible unfortunately. The best you can do is use where T : struct, IComparable, IConvertible, IFormattable
(which of course is not the same). The interface restrictions are derived from the implementation of System.Enum
.
Apart from that, you can check if typeof(T).IsEnum
, which can detect the problem at runtime and presumably throw an exception. But there is no way to enforce this restriction at compile time.