Function arrayInserter
arrayInserter makes an output range out of an array.
auto arrayInserter(Array)
(
scope ref return Array array
)
if (isArray!Array);
The returned output range accepts single values as well as input ranges that can be copied into the target array.
Parameters
Name | Description |
---|---|
Array | Array type. |
array | Array. |
Returns
An output range writing into array.
Example
int[1] array;
arrayInserter(array)(5);
assert(array[0] == 5);
Example
char[1] array;
alias Actual = typeof(arrayInserter(array));
static assert(isOutputRange!(Actual, char));
static assert(isOutputRange!(Actual, char[]));