Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
enum class is a two-word keyword that has different meanings, depending on the standard used:
enum class in the C++98 standard
enum class in the C++0x standard
enum class in the C++98 standard
enum class is not supported in C++98.
enum class in the C++0x standard
An enum class is a conversion-safe enum:
enum class Color { red , orange }; |
Screen output:
cannot convert 'Color' to 'Fruit' in initialization |
Technical note: the code shown is compiled successfully using the G++ 4.4.5 compiler, which is supplied with the Qt Creator 2.0.0 IDE.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.