http://d.puremagic.com/issues/show_bug.cgi?id=7058



--- Comment #1 from Trass3r <mrmoc...@gmx.de> 2011-12-02 19:04:09 PST ---
Interestingly enough, if you add a tuple it only respects the first value at
all:

void main()
{
    import std.stdio;
    vec3 v = {1.5f, 1.f, 0.5f};
    writeln(v);
}

template Tuple(T...)
{
    alias T Tuple;
}

template Repeat(T, int count)
{
    static if (!count)
        alias Tuple!() Repeat;
    else
        alias Tuple!(T, Repeat!(T, count-1)) Repeat;
}

struct vec3
{
    union
    {
        struct
        {
            float x = 0;
            float y = 0;
            float z = 0;
        }
//        float[3] cell;
        Repeat!(float, 3) tuple;
    }
}

$ dmd -run vector.d
vec3(1.5, nan, nan, 1.5, nan, nan)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to