Compiler Error C2166
l-value specifies const object
Code attempts to modify an item declared const
.
The following sample generates C2166:
// C2166.cpp
int f();
int main() {
( (const int&) 1 ) = 5; // C2166
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
l-value specifies const object
Code attempts to modify an item declared const
.
The following sample generates C2166:
// C2166.cpp
int f();
int main() {
( (const int&) 1 ) = 5; // C2166
}