r/learnprogramming • u/Vericus • Feb 29 '12
[C++] Why is vector<bool> bad?
I was thinking of creating a matrix of boolean values and I thought of vector<vector<bool>>, but after reading about vector<bool>, many websites have said it's something that should be avoided and it's bad programming.
Can someone explain to me why? I never really found a concrete explanation for why vector<bool> was bad. It only uses one bit which is 8 times smaller than char, shouldn't that mean its much better than using any other method of creating a matrix of bools in terms of size?
7
Upvotes
View all comments
Show parent comment
1
u/calc0000 Feb 29 '12
Can you elaborate more on this?