BSD style: see
license.txt
Initial release: April 2008
Kris
0.99.7
- struct Vector(V, int Size = 0) ¶#
-
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.
- Vector* clear() ¶#
-
Clear the vector
- uint size() ¶#
-
Return depth of the vector
- uint unused() ¶#
-
Return remaining unused slots
- Vector clone() ¶#
-
Returns a (shallow) clone of this vector
- V* add(V value) ¶#
-
Add a value to the vector.
Throws an exception when the vector is full
- V* add() ¶#
-
Add a value to the vector.
Throws an exception when the vector is full
- Vector* append(V[] value...) ¶#
-
Add a series of values to the vector.
Throws an exception when the vector is full
- V remove() ¶#
-
Remove and return the most recent addition to the vector.
Throws an exception when the vector is empty
- V remove(uint i) ¶#
-
Index vector entries, where a zero index represents the
oldest vector entry.
Throws an exception when the given index is out of range
- V opIndex(uint i) ¶#
-
Index vector entries, as though it were an array
Throws an exception when the given index is out of range
- V opIndexAssign(V value, uint i) ¶#
-
Assign vector entries as though it were an array.
Throws an exception when the given index is out of range
- V[] slice() ¶#
-
Return the vector as an array of values, where the first
array entry represents the oldest value.
Doing a foreach() on the returned array will traverse in
the opposite direction of foreach() upon a vector
- V error(size_t line) [private] ¶#
-
Throw an exception
- int opApply(int delegate(ref V value) dg) ¶#
-
Iterate from the most recent to the oldest vector entries
- int opApply(int delegate(ref V value, ref bool kill) dg) ¶#
-
Iterate from the most recent to the oldest vector entries