StaticBitArray.opCast

Undocumented in source. Be warned that the author may not have intended to support it.
  1. bool opCast()
    struct StaticBitArray(uint capacity, Block = DefaultBlock)
    @safe const
    bool
    opCast
    (
    T : bool
    )
    ()
    if (
    isUnsigned!DefaultBlock
    )
  2. void[] opCast()
  3. size_t[] opCast()

Examples

construct from dynamic array

static bool[] ba = [1,0,1,0,1];
auto a = StaticBitArray!5(ba);
assert(a);
assert(!a.allZero);

ditto

static bool[] ba = [0,0,0];
auto a = StaticBitArray!3(ba);
assert(!a);
assert(a.allZero);

construct from static array

static bool[3] ba = [0,0,0];
auto a = StaticBitArray!3(ba);
assert(!a);
assert(a.allZero);

Meta