Enum class 는 Enum처럼 바로 int 할당은 안되고 static_cast를 사용.
#include <iostream>
using namespace std;
enum class E_OptionType {
Red,
Blue,
Green,
None
};
int main()
{
int testNumber = static_cast<int>(E_OptionType::Blue);
// int errorEx = E_OptionType::Blue; // Error
cout << testNumber << "\n";
testNumber = static_cast<int>(E_OptionType::Green);
cout << testNumber << "\n";
}