编译器错误 C2166

左值指定 const 对象

代码尝试修改声明为 const的项。

下面的示例生成 C2166:

// C2166.cpp
int f();
int main() {
   ( (const int&) 1 ) = 5;   // C2166
}