Open fanejonda opened 1 year ago
It is indeed the case, bvector<> is actually size-less and technically it contains a whole tail of zeroes at the end. It is possible to use keep_range() to clip the vector. I guess the API really needs flip_range() method...
Hi,
It appears that there is a bug in the implementation of the flip function (full vector flip). The flipping seems to assume that there is a large tail of zeroes at the end of every bvector and flipping causes that implicit tail to become real.
To reproduce:
The output
I would have expected that a flipping operation would not change the size of the vector and the post flip count to be 9.
This also affects other APIs, because the rest of the code now believes there is a big set of 1s at the end of the vector.