https://issues.dlang.org/show_bug.cgi?id=20112
Iain Buclaw <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Iain Buclaw <[email protected]> --- That's because `__vector(int[4]) i = cast(__vector(int[4])) f;` is a reinterpret cast. Semantically, this can only be done by unrolling the assignment, but probably easier to do this in phobos std.conv instead. private T to(T, S)(S value) { alias E = typeof(T.init[0]); T res = void; static foreach (i; 0 .. S.length) res[i] = cast(E)value[i]; return res; } void main() { import std.stdio; __vector(float[4]) f = [3, 2, 1, 0]; __vector(int[4]) i = to!(__vector(int[4]) f; writeln(i[0]); } --
