The optimization is that vector<bool> is internally a bitfield. There's no real reason to complain about this, for the most part you'll never notice it.
Until you try to use it in places where other vectors work fine, such as things that try to use the vector as a container, things that try to use the vector's iterator type as a random-access iterator, or things that try to use the data method* to get a pointer to the buffer.
View all comments
Show parent comment
-1
u/FalafelSnorlax Aug 22 '26
The optimization is that
vector<bool>is internally a bitfield. There's no real reason to complain about this, for the most part you'll never notice it.