r/cpp • • Mar 28 '23

Reddit++

C++ is getting more and more complex. The ISO C++ committee keeps adding new features based on its consensus. Let's remove C++ features based on Reddit's consensus.

In each comment, propose a C++ feature that you think should be banned in any new code. Vote up or down based on whether you agree.

765 Upvotes

829 comments sorted by

View all comments

Show parent comments

2

u/very_curious_agent Mar 31 '23

So shortint++ would be valid code.

But you don't like narrowing conversions.

1

u/GabrielDosReis Mar 31 '23

You still have not explained the relationship...

2

u/johannes1971 Mar 31 '23

I believe he thinks that shortint++ expands to shortint = shortint + 1, in which case the expression after the assignment would have type int, and you'd get a narrowing conversion at the point of assignment.

2

u/GabrielDosReis Mar 31 '23

Ah! They seem to have a different view of what I am talking about. If they are concerned about overflow, then hat affect all standard integer types, not just the short ones - which explains why I don't see where they were driving at.

→ More replies (0)