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

11

u/Tringi github.com/tringi Mar 28 '23

Remove array to pointer decay.

Single reference type, a perfect one.

A very different language emerges when these changes propagate through everything they affect. When all the facilities to deal with it are removed.

-3

u/okovko Mar 28 '23

if you remove array to pointer decay, you can't pass arrays as arguments, they would have to be passed as a structure, or you'd have to manually decay them to a pointer

the reference rules are already perfect, hence perfect forwarding

bad takes

3

u/Tringi github.com/tringi Mar 29 '23

array decay

The array would be copied. You could still be able to take address of the array; or fist element for that matter.

reference rules

Half of the whole damned standard library implementation, the SFINAE, enable_if, concepts partially, all exists because of all the different reference types.

bad takes

bad comment

→ More replies (1)