vector

Construct Vector directly from elements, inferring element type.

  1. Vector!(T, N) vector(T[N] elements)
  2. Vector!(CommonType!Args, Args.length) vector(Args args)
    @safe @nogc nothrow
    Vector!(CommonType!Args, Args.length)
    vector
    (
    Args...
    )
    (
    const auto ref Args args
    )
    if (
    !is(CommonType!Args == void)
    )

Examples

auto v = vector(1f, 2, 3);
assert(is(typeof(v) == Vector!(float, 3)));
assert(v == [1f, 2f, 3f]);

Meta