Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 7.0.4 - example not compliant with 7.0.5?
#1
Hi,

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!
Reply


Messages In This Thread
Rule 7.0.4 - example not compliant with 7.0.5? - by cgpzs - 12-09-2024, 12:56 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)