Compare commits

...

3 Commits

1 changed files with 13 additions and 0 deletions

View File

@ -469,4 +469,17 @@ unittest
public T[] removeResize(T)(T[] array, size_t position)
{
return array.shiftInto(position, false, true);
}
/**
* Tests removing an element from an array
*/
unittest
{
int[] numbas = [1, 5, 2];
numbas = numbas.removeResize(1);
// should now be [1, 2]
writeln(numbas);
assert(numbas == [1, 2]);
}