what's the best way to perform bitwise operations on vector<bool>
?
as i understand, vector<bool>
is a specialisation that uses one bit per boolean. I chose vector<bool>
for memory saving reasons. I know that there are some problems with vector<bool>
but for my needs it's apropriate.
now - what's the most performant way of aplying bitwise operations to whole such vectors?
if i do it in a for loop and readout each single bool and store it back, the way I understand it a lot more operations are performed inside in order to access the actual values.
thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…