niknaks.arrays

Arrays tooling

Members

Functions

filter
void filter(T[] filterIn, Predicate!(T) predicate, T[] filterOut)

Filters items by the given predicate

findNextFree
bool findNextFree(T[] used, T found)

Given an array of values this tries to find the next free value of which is NOT present within the given array.

insertAt
T[] insertAt(T[] array, size_t position, T value)

Inserts the given value into the array at the provided index

isPresent
bool isPresent(T[] array, T value)

Checks if the given value is present in the given array

removeResize
T[] removeResize(T[] array, size_t position)

Removes the element at the provided position in the given array

shiftInto
T[] shiftInto(T[] array, size_t position, bool rightwards, bool shrink, T filler)

Shifts a subset of the elements of the given array to a given position either from the left or right.

shiftIntoLeftwards
T[] shiftIntoLeftwards(T[] array, size_t position, bool shrink)

Leftwards shifting into

shiftIntoRightwards
T[] shiftIntoRightwards(T[] array, size_t position, bool shrink)

Rightwards shifting into

unique
T[] unique(T[] array)

Returns a version of the input array with only unique elements.

Meta

Authors

Tristan Brice Velloza Kildaire (deavmi)