Array.opIndex

Return Value

Type: Range

Random access range that iterates over elements of the array, in forward order.

Examples

const v1 = Array!int([6, 123, 34, 5]);

assert(v1[0] == 6);
assert(v1[1] == 123);
assert(v1[2] == 34);
assert(v1[3] == 5);
static assert(is(typeof(v1[0]) == const(int)));
static assert(is(typeof(v1[])));

Meta