2
为什么这里的枚举变量是右值?
例: typedef enum Color { RED, GREEN, BLUE } Color; void func(unsigned int& num) { num++; } int main() { Color clr = RED; func(clr); return 0; } 编译时出现以下错误: <source>: In function 'int main()': <source>:16:9: error: cannot bind non-const lvalue reference of type 'unsigned int&' to an rvalue of type …