3 ms·
> we care about the type of x because we need to cast to a 16-bit int because it is going to be use to communicate with hardware IMO you should still use auto
by plorkyeran 12y ago
> we care about the type of x because we need to cast to a 16-bit int because it is going to be use to communicate with hardware
IMO you should still use auto there and use a static_cast<int16_t> on the RHS to make it clear to the reader that you're deliberately converting it.
- RogerL 12y agoYou're right.