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

14

u/fdwr fdwr@github 🔍 Mar 28 '23

Just last week. Was trying to call a function that takes a pointer to bool's + count, and thought I could store the values in an std::vector. Nope! All the work-arounds (like temporary bool wrappers) required extra work. So I (semantically made me feel dirty, but worked) stuffed them into an std::basic_string<bool> instead and then effortlessly called the function with s.data() and s.size(). 😅

7

u/[deleted] Mar 28 '23

boost::vector doesn't have this silly specialization, you can use that instead.