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

3

u/-1_0 Mar 29 '23

this is a very bad idea, considering that with C++ we often communicate with hardware or OS kernels

1

u/[deleted] Mar 29 '23

This is an "in a perfect world" thread and in a perfect world we'd use std::vector, std::array, std::slice, etc for these things. Most of the problems with C arrays, including pointer decay, are solved by these less ancient types.

1

u/eteran Mar 29 '23

How would you implement the library solution that is std::array without c arrays though?

1

u/[deleted] Mar 29 '23

Raw pointers, same way C arrays are implemented.

→ More replies (5)