What is the point of having
enum SomeEnum : byte // <----
{
SomeValue = 0x01,
...
}
when you have to make a cast just to assign it t
Not much point, really, except that if the default underlying type (int
) is not enough for you, ie. you want to use higher integer values than that then you can make it long
. This can be useful when you have a [Flags]
enum with more than 32 values.
You can make it byte
or short
just to restrict the range of values, but it will actually still take 4 bytes (ie. same as int
).