Tag Archives: Puzzle

Polymorphic enums in C#, implementation revealed

How can we implement a polymorphic enum to mimic the Java ones ? In a previous post, as an answer to @cyriux’s one, I showed how we could try to use a polymorphic enum in C# in order to mimic … Continue reading

Posted in Syntax Puzzles | Tagged , , , | Comments Off

Polymorphic enums in C#, generic incrementation

During the implementation of my polymorphic enum, I have chosen to allow several types for the underlying “ordinal” value, as it is also possible for standard C# enums… From the MSDN documentation, the allowed underlying types for enum types are … Continue reading

Posted in Syntax Puzzles | Tagged , , | Comments Off

Polymorphic enums in C# ?

Using Java as a inspiration source for C# (hmm wait, hasn’t that already been done from the start ?) A few weeks ago, I read this post by @cyriux, describing how you could use polymorphic enums in Java. Actually, I … Continue reading

Posted in Syntax Puzzles | Tagged , , , | Comments Off