12-09-2024, 12:56 PM
Hi,
Rule 7.0.4 provides this example as compliant, and does not violate other rules (like other examples)
Why doesn't this example violate 7.0.5? Bit shift applied on uint16_t will cause integral promotion from uint16_t to int, thus violating 7.0.5, or?
Thanks!
Rule 7.0.4 provides this example as compliant, and does not violate other rules (like other examples)
Code:
static_cast< uint16_t >( u8 + u16 ) << 2; // Compliant
Why doesn't this example violate 7.0.5? Bit shift applied on uint16_t will cause integral promotion from uint16_t to int, thus violating 7.0.5, or?
Thanks!