TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
C++ Coding Standard

Rule:  CON#001Checked automatically with code checker

Synopsis:Make unsafe type conversions explicit rather than implicit
Severity Level:2

If casting is required, make it explicit and use the following C++ cast operators:
  • const_cast: to remove the const, volatile, and __unaligned attributes.
  • dynamic_cast: for conversion of polymorphic types, where class hierachy navigation is unavoidable.
  • static_cast: for conversion of nonpolymorphic types.

    This rule does not only apply to casting: it also applies to unsafe conversions by means of constructors, conversion operators, and conversion functions. See further [INT#001], [INT#017], [POR#022].