Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 564 Bytes

File metadata and controls

23 lines (18 loc) · 564 Bytes
title Warning C26492
ms.date 03/22/2018
f1_keywords
C26492
NO_CONST_CAST
helpviewer_keywords
C26492
description CppCoreCheck rule C26492 that enforces C++ Core Guidelines Type.3

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
}