unittest
{
import std.bitmanip : BitArray;
import std.range : repeat;
import std.array : array;
BitArray ba = true.repeat(64).array;
ba >>= 1;
assert((cast(uint[])ba)[$-1] == 0x7FFF_FFFF);
}
When a BitArray covers exactly 32, 64, 96 and so on number of bits, the bit shifting operation fills the last word with zeroes. The test above should pass, but doesn't.
Comment #1 by petar.p.kirov — 2017-12-29T10:25:33Z