ContiguousList

A list, fast to be iterated, slow to be reorganized. Encapsulates an Array!T and interfaces it as a list.

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(T item)

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

add
ptrdiff_t add(I items)

Adds items at the end of the list.

array
Array!T array()

Returns the internal array.

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.

insert
ptrdiff_t insert(T item)

Inserts an item at the beginning of the list.

insert
ptrdiff_t insert(size_t position, T item)

Inserts an item at a given position.

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

Support for the foreach operator.

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

Support for the foreach_reverse operator.

opAssign
void opAssign(T[] items)

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

opAssign
void opAssign(Array!T items)

Replaces the items with the content of an Array!T.

opIndex
T opIndex(ptrdiff_t i)

Support for the array syntax.

opIndexAssign
void opIndexAssign(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