Rule M5-0-10 (required, implementation, automated)

If the bitwise operators ~and << are applied to an operand with an underlying type of unsigned char or unsigned short, the result shall be immediately cast to the underlying type of the operand. See MISRA C++ 2008 [7]