Product Type

BitArray

An array of bit values represented as Booleans, where true indicates that the bit is on.

Members

Functions

fun count() -> Int

Returns the number of bits in the array.

fun capacity() -> Int

Returns the number of bits that the array can contain before allocating new storage.

fun append(_ bit: Bool) { inout }

Adds a new element at the end of the array.

fun set_value(_ b: Bool, for p: Position) { inout }

Sets the value b for the bit at position p.

Subscripts

subscript(_ i: Int): Bool { let, inout }

Accesses the bit at the given index.

Initializers

init()

Creates an empty array.