后端 枚举类

anxing7 · May 05, 2020 · 6 hits
enum class Error{ OK, FileNotFount, OutOfMemory};
enum oldStyle{OH, OK, OR};
  • 枚举值能直接赋予 int 变量,可读性差
  • 枚举类必须用 static_cast 进行转换
No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.