vector

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

vector
(
E...
)
()
if (
E.length > 1 &&
E.length <= 4
&&
!is(CommonType!E == void)
)

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