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

Category: Conversions

Synopsis:Type Conversions


Description:
This chapter concerns the conversion of objects from one type to another. Wrong usage of conversions may result in less robust code.

Coding Rules

NameCheckedSynopsis
CON#001 Checked automatically with code checker Make unsafe type conversions explicit rather than implicit
CON#002 Checked automatically with code checker Do not cast away const
CON#003 Checked automatically with code checker Avoid explicit type conversions (casts) if possible
CON#004 Checked automatically with code checker Use the new cast operators (static_cast, const_cast, dynamic_cast, and reinterpret_cast) instead of the C-style casts
CON#005 Declare a data member mutable if it must be modified by a const member function and has no influence on the state of the program
CON#006 Prefer static_cast over reinterpret_cast if possible
CON#007 Checked automatically with code checker Do not convert implicitly from a boolean type to a non-boolean type, and vice versa.
CON#008 Checked automatically with code checker Don't take the address of an array