StaticBitArray.opIndexAssign

Sets the i'th bit. No range checking needed.

  1. bool opIndexAssign(bool b, Index2 i)
  2. bool opIndexAssign(bool b, Mod!(capacity, ModUInt) i)
    struct StaticBitArray(uint capacity, Block = DefaultBlock)
    @safe pragma(inline, true) @trusted
    static if(capacity >= 1)
    bool
    opIndexAssign
    (
    ModUInt
    )
    (
    bool b
    ,
    Mod!(capacity, ModUInt) i
    )
    if (
    isUnsigned!ModUInt
    )
    if (
    isUnsigned!DefaultBlock
    )

Examples

StaticBitArray!2 bs;
bs[0] = true;
assert(bs[0]);
assert(!bs[1]);
bs[1] = true;
assert(bs[1]);

Meta