Given this,

´´´
import std.bitmanip;
import core.stdc.limits;

void main()
{
        BitArray ba;
ba.length = size_t.sizeof * CHAR_BIT; // enough length, known at compile time
        size_t arbitrary; // = random size_t, not known at compile time

        // ba ???assign??? arbitrary;
        assert(cast(size_t[])ba == [arbitrary]);
}
´´´

how to convert a number to a BitArray as fast as possible, given that the BitArray is already allocated to the needed length? Is bit checking the way to go, or is there a way to cast one to the other somehow?

Reply via email to