removeShift

Removes elements from the middle of a buffer, maintaining the order of the remaining elements by shifting them left using memmove.

Template params: T = type of buffer element

  1. T[] removeShift(Buffer!(T) buffer, size_t index, size_t remove_elems)
    T[]
    removeShift
    (
    T
    )
    (
    ref Buffer!(T) buffer
    ,
    size_t index
    ,
    size_t remove_elems = 1
    )
  2. T[] removeShift(T[] buffer, size_t index, size_t remove_elems)

Parameters

buffer Buffer!(T)

buffer to remove from

index size_t

position in buffer from which to remove elements

remove_elems size_t

number of elements to remove, defaults to one

Return Value

Type: T[]

slice of buffer

Examples

auto arr = createBuffer("something");
removeShift(arr, 3, 4);
test!("==")(arr[], "somng"[]);

Meta