Vector

A vector of the given value-type V, with maximum depth Size. Note that this does no memory allocation of its own when Size != 0, and does heap allocation when Size == 0. Thus you can have a fixed-size low-overhead instance, or a heap oriented instance.

Members

Aliases

opSlice
alias opSlice = slice
Undocumented in source.
push
alias push = add
Undocumented in source.

Functions

add
V* add(V value)

Add a value to the vector.

add
V* add()

Add a value to the vector.

append
Vector* append(V[] value)

Add a series of values to the vector.

clear
Vector* clear()

Clear the vector

clone
Vector clone()

Returns a (shallow) clone of this vector

opApply
int opApply(int delegate(ref V value, ref bool kill) dg)

Iterate from the most recent to the oldest vector entries

opApply
int opApply(int delegate(ref V value) dg)

Iterate from the most recent to the oldest vector entries

opIndex
V opIndex(uint i)

Index vector entries, as though it were an array

opIndexAssign
V opIndexAssign(V value, uint i)

Assign vector entries as though it were an array.

remove
V remove()

Remove and return the most recent addition to the vector.

remove
V remove(uint i)

Index vector entries, where a zero index represents the oldest vector entry.

size
uint size()

Return depth of the vector

slice
V[] slice()

Return the vector as an array of values, where the first array entry represents the oldest value.

unused
uint unused()

Return remaining unused slots

Templates

opOpAssign
template opOpAssign(string op : "~")
Undocumented in source.

Meta