I don't know what this comment is trying to say. Dynamic bool collections with and without bit packing are both legitimate use cases, and of the two, vector<bool> should obviously be the latter because that is how vector already works. If you want a tightly packed collection that breaks vector's invariants, it should be its own type and not a specialization of vector.
I'm not sure what "wrong implementation of bool" is meant to mean either. A bool in C++ is not a single bit, definitionally.
Just when implement class need follow rules to all, not make 1 out of rest. Mem usage be good, but for it can be new one like memCompactVector<bool> etc.
View all comments
Show parent comment
1
u/narrill 17d ago
I don't know what this comment is trying to say. Dynamic bool collections with and without bit packing are both legitimate use cases, and of the two,
vector<bool>should obviously be the latter because that is howvectoralready works. If you want a tightly packed collection that breaksvector's invariants, it should be its own type and not a specialization ofvector.I'm not sure what "wrong implementation of bool" is meant to mean either. A bool in C++ is not a single bit, definitionally.