IndexedArray

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

Alias This

_r

Members

Aliases

Index
alias Index = I
Undocumented in source.
R
alias R = E[I.max + 1]
Undocumented in source.

Mixins

__anonymous
mixin _genIndexAndSliceOps!I
Undocumented in source.

Variables

_r
R _r;
Undocumented in source.

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