i would like to use scoped enumeration in my project.
declaring an unscoped enum as a public member of a class works as intended:
enum deviceType_t_ { GENERAL, CAMERAROTATOR, DOME, FILTERWHEEL, FOCUSER, SAFETYMONITOR, TELESCOPE };
but scoped declaration of the same enum enum class deviceType_t_ { GENERAL, CAMERAROTATOR, DOME, FILTERWHEEL, FOCUSER, SAFETYMONITOR, TELESCOPE };
gives me the following error:
EEPROMHandler.h:15: error: expected identifier before 'class'
EEPROMHandler.h:15: error: ISO C++ forbids declaration of 'GENERAL' with no type
EEPROMHandler.h:15: error: ISO C++ forbids declaration of 'CAMERAROTATOR' with no type
EEPROMHandler.h:15: error: ISO C++ forbids declaration of 'DOME' with no type
EEPROMHandler.h:15: error: ISO C++ forbids declaration of 'FILTERWHEEL' with no type
EEPROMHandler.h:15: error: ISO C++ forbids declaration of 'FOCUSER' with no type
EEPROMHandler.h:15: error: ISO C++ forbids declaration of 'SAFETYMONITOR' with no type
EEPROMHandler.h:15: error: ISO C++ forbids declaration of 'TELESCOPE' with no type
EEPROMHandler.h:15: error: expected ';' before '}' token
EEPROMHandler.h:15: error: expected `;' before '}' token
EEPROMHandler.h:15: error: multiple types in one declaration
any ideas? what i want to do in my code is to compare an uint8_t to enumerators of a specific enum.