This has always bugged me. Perhaps someone with some hardcore knowledge of .NET internals can explain it to me.
Suppose I define an enum as follows:
publ
The issue was performance. It is quite simple to have a checked enum for normal enums such as Color
enum Color {
Red,
Blue
}
The problem though is for enum's which are used as bit flags.
enum Property {
IsFirst = 0x1,
IsDefault = 0x2,
IsLastAccessed = 0x4
}
Having to do a bitwise check for every single integer which is converted to an Enum value was deemed to be too expensive. Hence the relaxed conversion to enum values.