If you want an enum with all the values equal to each other, then the enum is useless.
That code will throw a WtfException. Is this what you really want? If so, then you don't want an enum.Code:enum Shapes { Line = 0, Circle = 0 } public void Method () { Shapes shape = Shapes.Line; if (shape == Shapes.Circle) throw new WtfException (); }




Reply With Quote