G
Guest
When the enum inherients a type it would be nice not to have to do a cast to
that type.
enum MyEnum: int{one=1,two=2}
MyEnum Mine = 1; // no error!
It would be nice to constrain an enum to a function call (makes code easier
to read, and prevents bad calls)
public int MyRouting(enum inEnum{one=1, two=2} ){ return (int)inEnum;}
int i = MyRoutine(one); // enum would only have scope in routine and calls
to routine
that type.
enum MyEnum: int{one=1,two=2}
MyEnum Mine = 1; // no error!
It would be nice to constrain an enum to a function call (makes code easier
to read, and prevents bad calls)
public int MyRouting(enum inEnum{one=1, two=2} ){ return (int)inEnum;}
int i = MyRoutine(one); // enum would only have scope in routine and calls
to routine