Vector.opCast

Converts the vector to the given one, mantaining the variables's value when possible.

  1. auto opCast()
    struct Vector(T, char[] c)
    @safe
    opCast
    (
    F
    )
    ()
    if (
    c.length > 1 &&
    areValidCoordinates(c)
    )
  2. auto opCast()

Examples

assert(cast(Vector2!int)vector(.1, .1, 14) == vector(0, 14));
assert(cast(Vector4!real)vector(.5, 100) == vector(.5, 0, 100, 0));
// this will only return the vector
assert(cast(Vector2!int

Meta