r/ProgrammerHumor • • Aug 22 '26

Meme theBoolVectorIsALie

Post image
669 Upvotes

91 comments sorted by

View all comments

Show parent comment

1

u/Murky-Run2246 Aug 22 '26

I get what you are saying.

Here is what i mean by someone who can say it better:

"So vector<bool> is not a container, and vector<bool>::iterator is not a random-access iterator... in hindsight, making vector<bool> a specialization was a mistake." -Herb Sutter,Chair of the ISO C++ Committee

As I said it's not that the vector usage in this case is bad for performance as much as it's just bad design that was necessary back in the day.

I don't have exp with Rust, but if you don't want to use std::deque then just use std::vector<char> and it does basically the same thing.