请勿使用
const_cast强制转换掉const。const_cast不是必需的;此转换不会消除 constness 或 volatility。
另请参阅
示例
void function(int* const constPtrToInt)
{
auto p = const_cast<int*>(constPtrToInt); // C26465, const is not being removed
}
请勿使用
const_cast强制转换掉const。const_cast不是必需的;此转换不会消除 constness 或 volatility。
void function(int* const constPtrToInt)
{
auto p = const_cast<int*>(constPtrToInt); // C26465, const is not being removed
}