IndexedArray

Statically-Sized Array of ElementType E indexed by I. TODO assert that I is continuous if it is a enum.

struct IndexedArray (
E
I
) if (
isIndex!I
) {
R _r;
}

Alias This

_r

Mixed In Members

From mixin _genIndexAndSliceOps!I

Examples

enum N = 7;
enum I { x = 0, y = 1, z = 2}
alias E = int;
alias A = IndexedArray!(E, I);
static assert(A.sizeof == 3*int.sizeof);
A x;
x[I.x] = 1;
x[I.y] = 2;
x[I.z] = 3;
static assert(!__traits(compiles, { x[1] = 3; })); // no integer indexing

Meta