Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 663 Bytes

c26465.md

File metadata and controls

24 lines (19 loc) · 663 Bytes
title ms.date ms.topic f1_keywords helpviewer_keywords description
C26465
03/22/2018
reference
C26465
C26465
CppCoreCheck rule C26465 that enforces C++ Core Guidelines Type.3

C26465 NO_CONST_CAST_UNNECESSARY

Don't use const_cast to cast away const. const_cast is not required; constness or volatility is not being removed by this conversion.

See also

C++ Core Guidelines Type.3

Example

void function(int* const constPtrToInt)
{
  auto p = const_cast<int*>(constPtrToInt); // C26465, const is not being removed
}