In a C# enumeration, are there any negative side effects of using a negative number?
I am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this.
public enum ResponseCodes
{
InvalidServerUserPasswordCombo = -1,
// etc.
}
Clearly, with any underlying signed type, any bitwise operations are going to get “interesting” very quickly.
But using an enum as a collection of related constants can quite happily use negative values.