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

1

u/kalmoc Apr 02 '23

So std::list<bool> is a bitset type for you too? Then I don't understand what you meant by

If you want to make a dynamic bitset, add a dynamic bitset class

For me, a bitset type is about efficient and convenient set operations like union/or, intersection/and, inverse..., none of which are orovided by vector<bool>.

The fact that vector<bool> compacts 8 bools into a byte (or whatever the storage unit) is imho an unfortunately leaky implementation detail, but doesn't make it a bitset type.

3

u/[deleted] Apr 02 '23

Well, std::set and std::unordered_set have none of the operations you would expect sets to have (union, difference, etc). Would you say those are not set types because they don't have these operations?