Quote Originally Posted by jlou
Code:
typedef enum { red = 1, green = 2, blue = 3 } color;
color c = 24;
What should the compiler do with that? Since it can't reasonably know what to do, it doesn't allow it.
well lets work on your example...enum does allow ranges...so if you have

Code:
enum colors { red = 1, blue = 10 };
colors myColor = static_cast<colors>(5); //perfectly legal!