Hi,

I'm trying to use BitArray instead of rolling my own. But how does one use it?

I tried:

import std.bitmanip : BitArray;

int main() {
        BitArray b;
        b[2] = true;
        return 0;
}

$ gdc l.d
$ gdb a.out
(gdb) r
Program received signal SIGSEGV, Segmentation fault.
0x0000000000438f88 in std.bitmanip.BitArray.opIndexAssign() (this=..., b=true,
    i=2) at ../../../../src/libphobos/src/std/bitmanip.d:604

Huh?

(gdc-4.8 (Ubuntu 4.8.2-19ubuntu1) 4.8.2)

I think I have to set "length" first. At least an example at the docs of bitsSet() halfway down the page does it...
  • BitArray crash Danny via Digitalmars-d-learn

Reply via email to