BitArray

Efficient version of Array!bool using only one bit per entry. But note that the interface is not compatible with Array!bool. In particular no ranges are provided. This is a design choice because using a bit-range in general algorithms is often very inefficient. In contrast specialized algorithms working on BitArray are typically very fast.

Constructors

this
this(size_t size)

constructor for given length

Destructor

~this
~this()

destructor

Postblit

this(this)
this(this)

post-blit that does a full copy

Members

Aliases

limb
alias limb = size_t
Undocumented in source.

Functions

capacity
size_t capacity()

number of elements this structure can hold without further allocations

count
size_t count(bool v)

count number of elements equal to v

empty
bool empty()

check for emptiness

length
size_t length()

number of elements

limbCount
size_t limbCount()

number of limbs in use

limbs
inout(limb)[] limbs()

returns limbs in use

opIndex
bool opIndex(size_t i)
opIndexAssign
void opIndexAssign(bool v, size_t i)

indexing

ptr
inout(limb)* ptr()
Undocumented in source. Be warned that the author may not have intended to support it.
reserve
void reserve(size_t newCap, bool overEstimate)

make sure this structure can contain given number of elements without further allocs

reset
void reset()

set all elements to false

resize
void resize(size_t size)

either cuts of or fills new elements with false

toggle
bool toggle(size_t i)

toggle element i, returns old value.

Manifest constants

limbBits
enum limbBits;
Undocumented in source.

Meta