I have an enum, and a couple of vectors of some of the contents of the enum. I want to change the enum to an enum class, for type safety, but I'm getting errors. Consider the following snippet:
#include <vector>
enum Colour {
red,
green,
blue
};
int main() {
const std::vector<Colour> something { red, green };
return 0;
}
It works fine. However, if I change the enum to an enum class, I get errors such as error: ‘green’ was not declared in this scope
. What can I do?