description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Compiler Error C2166 |
Compiler Error C2166 |
11/04/2016 |
|
|
12789c3a-cc76-48bb-ae2e-64283e0964ed |
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
}