static-cast
Writing invalid values to an enum or enum class variable
Please tell me, do the rules of the languages C and C++ allow writing an invalid value to a variable of the type enum or enum ... ONE = 1,
TWO,
THREE
};
const C c = static_cast<C>(value);// OK
Am I right? And if not, what am I wrong about?