vector

Construct Vector directly from static array, inferring element type.

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

Examples

auto v = [1, 2, 3].vector;
assert(v.elements == [1, 2, 3]);
assert(is(typeof(v) == Vector!(int, 3)));

Meta