[Issue 11147] Nested structs in a union are not correctly initialized

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 30 01:47:06 PDT 2013


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



--- Comment #1 from andrea.9940 at gmail.com 2013-09-30 01:47:05 PDT ---
> struct V {
>     union {
>         struct {
>             float x = 1;
>             float y = 1;
>         float z = 1;
>         }
>         struct {
>             float r;
>             float g;
>         float b;
>         }
>     }
> }

I posted the wrong code, the correct one is:
struct V {
    union {
        struct {
            float x = 0;
            float y = 0;
            float z = 0;
        }
        struct {
            float r;
            float g;
            float b;
        }
    }
}

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


More information about the Digitalmars-d-bugs mailing list