Array

A growable buffer that attempts to keep as many operations amortized as possible

Constructors

this
this()
Undocumented in source.
this
this(size_t initialCapacity)

Create a buffer with a given initial capacity

this
this(T[] array)

Create a buffer from a fixed-size array of elements

Members

Functions

add
void add(T val)

Appends a value to the end of the array

addAll
void addAll(A a)

Add many values in a compile-time list

clear
void clear()

Reset the element count without changing the size of the allocated chunk

destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
ensureCapacity
void ensureCapacity(size_t newCapacity)

Resizes the the array to be a given size manually

opApply
int opApply(int delegate(T) @(nogc) nothrow dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
T opIndex(size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndexAssign
T opIndexAssign(T value, size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
print
void print()
Undocumented in source. Be warned that the author may not have intended to support it.
remove
void remove(size_t index)

Remove an element at an index by swapping it with the last element

Properties

array
T[] array [@property getter]

Get the Array data as a D array

length
size_t length [@property getter]

Find the number of valid elements currently in the array

ptr
T* ptr [@property getter]

Get the pointer to the elements stored in the buffer

Meta