This a part of std.bitmanip.BitArray:
void init(void[] v, size_t numbits) in { assert(numbits <= v.length * 8); assert((v.length & 3) == 0); } body { ptr = cast(uint*)v.ptr; len = numbits; } But it seems this program works with no errors: import std.bitmanip: BitArray; void main() { ubyte[4] data; BitArray bits; bits.init(data, 100); } Do you kno why is this assert present? assert((v.length & 3) == 0); Isn't this enough? assert((v.length & 2) == 0); Bye, bearophile