DynamicIndexedArray

Defragmenting array with referencable value by index.

For optimisation purposes, the index returned by the foreach statement is the internal one : \ - Do not attempt to use this index for anything other than calling the markInternalForRemoval function.

Constructors

this
this()

Ctor

Members

Aliases

InternalIndex
alias InternalIndex = size_t
Undocumented in source.

Functions

markForRemoval
void markForRemoval(uint index)

The value will be removed with the next sweepMarkedData. \ Use the index returned by push.

markInternalForRemoval
void markInternalForRemoval(InternalIndex index)

The value will be removed with the next sweepMarkedData. \ Use the index given by the for loop.

opApply
int opApply(int delegate(ref T) dlg)
int opApply(int delegate(const ref T) dlg)
int opApply(int delegate(ref T, InternalIndex) dlg)
int opApply(int delegate(const ref T, InternalIndex) dlg)

= operator

opIndex
T opIndex(uint index)

[] operator

pop
void pop(uint index)

Immediatly remove a value from the list. \ Use the index returned by push.

push
uint push(T value)

Add a new item on the list.

reset
void reset()

Empty the list.

sweepMarkedData
void sweepMarkedData()

Marked values will be removed from the list. \ Call this function **outside** of the loop that iterate over this list.

Properties

capacity
uint capacity [@property getter]

Current max.

data
T[] data [@property getter]

The array itself. Avoid changing positions/size/etc.

length
uint length [@property getter]

Number of items in the list.

Meta