Vector.opDispatch

Implements swizzling.

  1. auto opDispatch [@property getter]
    struct Vector(T, int N)
    nothrow @nogc @property pure const nothrow
    opDispatch
    (
    string op
    U = void
    )
    ()
    if (
    isValidSwizzle!(op)
    )
  2. U opDispatch [@property setter]

Examples

vec4i vi = [4, 1, 83, 10];
assert(vi.zxxyw == [83, 4, 4, 1, 10]);

Meta