moveAll

Calls move(a, b) for each element a in src and the corresponding element b in tgt, in increasing order.

Preconditions: walkLength(src) <= walkLength(tgt). This precondition will be asserted. If you cannot ensure there is enough room in tgt to accommodate all of src use moveSome instead.

InputRange2
moveAll
(
InputRange1
InputRange2
)
(
InputRange1 src
,
InputRange2 tgt
)
if (
isInputRange!InputRange1 &&
isInputRange!InputRange2
&&
is(typeof(move(src.front, tgt.front)))
)

Parameters

src InputRange1

An input range with movable elements.

tgt InputRange2

An input range with elements that elements from src can be moved into.

Return Value

Type: InputRange2

The leftover portion of tgt after all elements from src have been moved.

Examples

int[3] a = [ 1, 2, 3 ];
int[5] b;
assert(moveAll(a[], b[]) is b[3 .. $]);
assert(a[] == b[0 .. 3]);
int[3] cmp = [ 1, 2, 3 ];
assert(a[] == cmp[]);

Meta