The OpenD Programming Language

BitArray.flip

Flips a single bit, specified by pos

  1. void flip()
  2. void flip(size_t pos)
    struct BitArray
    @nogc pure nothrow
    void
    flip
    (
    size_t pos
    )

Examples

auto ax = BitArray([1, 0, 0, 1]);
ax.flip(0);
assert(ax[0] == 0);

bool[200] y;
y[90 .. 130] = true;
auto ay = BitArray(y);
ay.flip(100);
assert(ay[100] == 0);

Meta