accessByString

Allows swizzling for vector types "Vector!(Type, Size)". Creates opDispatch containing available swizzle Usage:

// Params: T, size_t size,  string dataArrayName, string accessString, string dataSep, string accessSep

// Setting up separators automatically
mixin accessByString!(T, 4, "data", "x y z w");

// Data separator can be anything
mixin accessByString!(int, 3, "data", "x,y,z", ",");

// Same for access separator
mixin accessByString!(float, 3, "data", "x,y,z/r,g,b", ",", "/");

// What sily.vector uses:
static if (N == 2 || N == 3 || N == 4) {
    static if (N == 2) private enum AS = "x y|w h|u v"; 
    else
    static if (N == 3) private enum AS = "x y z|w h d|u v t|r g b"; 
    else
    static if (N == 4) private enum AS = "x y z w|r g b a";
    mixin accessByString!(T, N, "data", AS);
}

Members

Properties

opDispatch
T opDispatch [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
opDispatch
T opDispatch [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
opDispatch
auto opDispatch [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
opDispatch
U opDispatch [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta