I have a vector of booleans. I need to set its elements from n-th to m-th to true
. Is there an elegant way to do this without using a loop?
Edit: Tanks to all those who pointed out the problems with using vector<bool>
. However, I was looking for a more general solution, like the one given by jalf.