Containers

- Added `shiftIntoLeftwards` and `shiftIntoRightwards`
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-27 15:19:25 +02:00
parent eeb1fd4a46
commit 38169bbebd
1 changed files with 10 additions and 0 deletions

View File

@ -667,6 +667,16 @@ public T[] shiftInto(T)(T[] array, size_t position, bool rightwards = false, boo
return array;
}
public T[] shiftIntoRightwards(T)(T[] array, size_t position, bool shrink = false)
{
return shiftInto(array, position, true, shrink);
}
public T[] shiftIntoLeftwards(T)(T[] array, size_t position, bool shrink = false)
{
return shiftInto(array, position, false, shrink);
}
// rightwards testung (no shrink)
unittest
{