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
}
Trình duyệt này không còn được hỗ trợ nữa.
Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật.
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
}