the array to scan
the starting index
the ending index
the items to replace in-between from and to
int[] a = [1, 4, 5]; replaceInPlace(a, 1u, 2u, [2, 3, 4]); assert(a == [1, 2, 3, 4, 5]); replaceInPlace(a, 1u, 2u, cast(int[])[]); assert(a == [1, 3, 4, 5]); replaceInPlace(a, 1u, 3u, a[2 .. 4]); assert(a == [1, 4, 5, 5]);
Replaces elements from array with indices ranging from from (inclusive) to to (exclusive) with the range stuff. Expands or shrinks the array as needed.