Created
November 16, 2015 14:47
-
-
Save sgkim126/8f88008cf015af631a8a to your computer and use it in GitHub Desktop.
cannot implicitly convert enum class to numeric
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum class Color { | |
Red, Green, Blue | |
}; | |
Color color = Color::Red; | |
switch (color) { | |
case 0: // error: could not convert '0' from 'int' to 'Color' | |
break; | |
case Color::Green: | |
break; | |
case Color::Blue: | |
break; | |
} | |
if (color) { // error: could not convert 'r' from 'Color' to 'bool' | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment