Collection

array based collection of items retains item order when during add/remove operations

Destructor

~this
~this()
Undocumented in source.

Members

Functions

add
void add(T item, size_t index)

insert new item in specified position

clear
void clear()

remove all items

indexOf
size_t indexOf(T item)

returns index of first occurence of item, size_t.max if not found

opApply
int opApply(int delegate(ref T param) op)

support of foreach with reference

opIndex
T opIndex(size_t index)

access item by index

opOpAssign
Collection opOpAssign(T item)

support for appending (~=, +=) and removing by value (-=)

remove
T remove(size_t index)

remove single item, returning removed item

removeValue
bool removeValue(T value)

remove single item by value - if present in collection, returning true if item was found and removed

Properties

length
size_t length [@property getter]

returns number of items in collection

length
size_t length [@property setter]

returns number of items in collection

size
size_t size [@property getter]

returns currently allocated capacity (may be more than length)

size
size_t size [@property setter]

change capacity (e.g. to reserve big space to avoid multiple reallocations)

Meta