float[] values = [1, 2]; assert(Vec4(values) == [1, 2, 0, 0]); import std.range : iota, stride; assert(Vec4(iota(4)) == [0, 1, 2, 3]); assert(Vec4(iota(8).stride(2)) == [0, 2, 4, 6]); assert(Vec4(iota(6)) == [0, 1, 2, 3]); import std.algorithm : map; auto isEven = iota(1024).map!(x => x % 2 == 0); assert(Vec4bool(isEven) == [true, false, true, false]);
Constructs a Vector with elements from an Input Range. Values not provided by range are initialized to 0, while additional values are ignored.