Basic Programming/C++ 11
C++11 - enum
Stayner
2016. 2. 26. 10:47
728x90
enum은 C++에서 이미 있는 키워드이다. 그러나 C++11에서는 C++03 표준과 달리 'unscoped enumeration'과 'scoped enumeration' 두 종류의 enum으로 바뀌었다.
1. unscoped enumeration은 기존(C++03) enum과 비슷하다. unscoped enumeration은 다음과 같이 정의한다.
2. scoped enumeration은 다음과 같이 정의 한다.
ps. enum class 대신 enum struct를 사용할 수도 있다.
728x90