Warning C26492
Don't use
const_cast
to cast awayconst
.
See also
Example
void function(const int* constIntPtr)
{
int* intPtr = const_cast<int*>(constIntPtr); // C26492, Do not use const_cast to cast away const
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Don't use
const_cast
to cast awayconst
.
void function(const int* constIntPtr)
{
int* intPtr = const_cast<int*>(constIntPtr); // C26492, Do not use const_cast to cast away const
}