Is there any potential problem when casting an int to enum when the int is greater than the number of possible values?
Is there any potential problem that I should be aware of when casting an int to enum when the int is greater than the number of possible values, say Here is the code snippet, which seems work well:) : #include <iostream> int main() { enum Demo{NONE=0, OK, HEART, OTHERS, FULL}; enum Demo demo = static_cast<enum … Read more