Redigera

Dela via


Warning C26492

Don't use const_cast to cast away const.

See also

C++ Core Guidelines Type.3.

Example

void function(const int* constIntPtr)
{
    int* intPtr = const_cast<int*>(constIntPtr); // C26492, Do not use const_cast to cast away const
}