Mixing the signedness of integral operands can easily lead to unexpected behaviour. After integral promotion, if the integral operands of an operator are of different signedness, there are three possible outcomes based on the ranks and bit-width of the operands. Compiler Explorer link: https://lnkd.in/dJNCe_s4 #cpp #cplusplus #coding #programming #dailybiteofcpp
For completness here are Bjarne words from TC++PL4: In my opinion, too many conversions are allowed. The whole 10.5. Implicit Type Conversions is worth reading in this context.
R&D Engineer with background in Physics | Curious about how the world works
2yI feel like C++ is way too liberal with implicit conversions. Are there any static checks that warn about these?