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(size_t i)

Index vector entries, as though it were an array

opIndexAssign
V opIndexAssign(V value, size_t i)

Assign vector entries as though it were an array.

opOpAssign
Vector* opOpAssign(V value)
Undocumented in source. Be warned that the author may not have intended to support it.
remove
V remove()

Remove and return the most recent addition to the vector.

remove
V remove(size_t i)

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

slice
V[] slice()

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

unused
size_t unused()

Return remaining unused slots

Properties

size
size_t size [@property getter]

Return depth of the vector

Meta