DynamicList

A List implementation, slow to be iterated, fast to be reorganized. This is a standard doubly linked list, with GC-free heap allocations.

Constructors

this
this(A elements)

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

add
ptrdiff_t add(ref T item)
ptrdiff_t add(T item)

Adds an item at the end of the list and returns its index.

add
ptrdiff_t add(T[] items)

Adds items at the end of the list and returns the last item index.

clear
void clear()

Empties the list.

count
size_t count()

Returns the items count.

extract
T extract(size_t index)

Removes an item from the list.

find
ptrdiff_t find(T item)

Tries to find an item in the list.

first
T first()

Returns the last element.

insert
ptrdiff_t insert(ref T item)
ptrdiff_t insert(T item)

Inserts an item at the beginning of the list.

insert
ptrdiff_t insert(size_t position, ref T item)
ptrdiff_t insert(size_t position, T item)

Inserts an item at a given position.

last
T last()

Returns the first element.

opApply
int opApply(int delegate(ref T) dg)

Support for the foreach operator.

opApplyReverse
int opApplyReverse(int delegate(ref T) dg)

Support for the foreach_reverse operator.

opAssign
void opAssign(T[] elems)

Replaces the items with the content of a D T[].

opIndex
T opIndex(ptrdiff_t i)

Support for the array syntax.

opIndexAssign
void opIndexAssign(ref T item, size_t i)

Support for the array syntax.

remove
bool remove(T item)

Removes an item from the list.

swapIndexes
void swapIndexes(size_t index1, size_t index2)

Exchanges the positions of two items.

swapItems
void swapItems(T item1, T item2)

Exchanges the positions of two items.

Meta