vector

Automatically creates a vector if the number of the given arguments matches one of the default vectors.

  1. auto vector(E args)
    vector
    (
    E...
    )
    ()
    if (
    E.length > 1 &&
    E.length <= 4
    &&
    !is(CommonType!E == void)
    )
  2. V vector(T tuple)

Examples

assert(is(typeof(vector(1, 1)) == Vector2!int));
assert(is(typeof(vector(2Lu, 4)) == Vector2!ulong));
assert(is(typeof(vector(5, 5, 19.0)) == Vector3!double));
assert(is(typeof(vector(0, real.nan, double.nan, float.nan)) == Vector4!real));

Meta