dvec

Build a Vec with specified component type T and size deducted from arguments.

alias dvec = vec!double

Examples

import std.algorithm : equal;
import std.traits : Unqual;

immutable v1 = dvec (1, 2, 4, 0); // none of the args is double
static assert( is(Unqual!(typeof(v1)) == DVec4) );
assert(equal(v1.data, [1, 2, 4, 0]));

immutable int[3] arr = [0, 1, 2];
immutable v2 = fvec(arr);
static assert( is(Unqual!(typeof(v2)) == FVec3) );
assert(equal(v2.data, [0, 1, 2]));

immutable v3 = dvec (1, 2);
immutable v4 = dvec (0, v3, 3);
static assert( is(Unqual!(typeof(v4)) == DVec4) );
assert(equal(v4.data, [0, 1, 2, 3]));

Meta