import core.simd, std.stdio;
void main()
{
float4 a = 1, b = 2;
writeln((a + b).array); // WORKS: [3, 3, 3, 3]
float4 c = [1, 2, 3, 4]; // ERROR: "Stored value type does
// not match pointer operand type!"
// [..a bunch of LLVM error code..]
float4 c = 0, d = 1;
c.array[0] = 4;
c.ptr[1] = 4;
writeln((c + d).array); // WRONG: [1, 1, 1, 1]
}
Oh, that doesn't work for me either. I never tried to use those,
so I didn't notice that before. This code gives me internal
compiler errors with GDC and DMD too (with "float4 c = [1, 2, 3,
4]" commented out). I'm using DMD 2.060 and a recent versions of
GDC and LDC on 64 bit Linux.