arrayInserter

$(D_PSYMBOL arrayInserter) makes an output range out of an array.

The returned output range accepts single values as well as input ranges that can be copied into the target array.

arrayInserter
(
Array
)
(
return scope ref Array array
)
if (
isArray!Array
)

Parameters

Array

Array type.

array Array

Array.

Return Value

Type: auto

An output range writing into array.

Examples

int[1] array;

arrayInserter(array)(5);
assert(array[0] == 5);
char[1] array;
alias Actual = typeof(arrayInserter(array));

static assert(isOutputRange!(Actual, char));
static assert(isOutputRange!(Actual, char[]));

Meta