VectorImpl

A @nogc dynamic array.

Constructors

this
this(T[] rhs)

Creates a new vector from a slice.

this
this(inout(SelfType) rhs)

Copy-constructor

this
this(size_t reserved)

Constructs a new vector with reserved amount of elements worth of memory reserved.

Destructor

~this
~this()
Undocumented in source.

Alias This

value

Members

Functions

clear
void clear()

Clears the vector, removing all elements from it.

flipEndian
auto ref flipEndian()

Flips the endianness of the vector's contents.

insert
void insert(T[] values, size_t offset)

Inserts a value into the vector.

insert
void insert(T value, size_t offset)

Inserts a value into the vector.

opOpAssign
void opOpAssign(T value)

Append a T to the vector.

opOpAssign
void opOpAssign(T[] other)

Append a range to the vector.

popBack
void popBack()

Pops the back element of the vector.

popFront
void popFront()

Pops the front element of the vector.

remove
void remove(T element)

Removes an element from the vector matching the given element.

removeAt
void removeAt(size_t i)

Removes the element at the given index.

removeAt
void removeAt(size_t i, size_t count)

Removes the elements at the given index with the given element count.

reserve
auto ref reserve(size_t newSize)

Attempts to reserve memory in the vector.

resize
auto ref resize(size_t newSize)

Resizes the vector.

reverse
auto ref reverse()

Reverses the contents of the vector

take
T[] take()

Take ownership of the memory owned by the vector.

Properties

back
T* back [@property getter]

Gets a pointer to the last element of the vector.

capacity
size_t capacity [@property getter]

The capacity of the vector.

empty
bool empty [@property getter]

Whether the vector is empty.

front
T* front [@property getter]

Gets a pointer to the first element of the vector.

length
size_t length [@property getter]

The length of the vector

ptr
T* ptr [@property getter]

Gets a pointer to the first element of the vector.

usage
size_t usage [@property getter]

The length of the vector, in bytes.

value
T[] value [@property getter]

Gets the internal memory slice.

Meta