Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

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

  • text
Václav Nádeníček

R&D Engineer with background in Physics | Curious about how the world works

2y

I feel like C++ is way too liberal with implicit conversions. Are there any static checks that warn about these?

Like
Reply
Cristian Voica

Deutsche Börse1K followers

2y

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.

See more comments

To view or add a comment, sign in

Explore content categories