struct init property

nocide benutzer at example.com
Thu Aug 23 10:33:30 PDT 2012


Am 23.08.2012 19:15, schrieb nocide:
> struct has no default constructor and instances are initialized with the
> init property.
> Can I declare or override the init property for a custom defined struct?
>

I've just realized, that I just have to declare default initializer for 
the members. This also works with unions!


struct Foo {
     int a;
     union {
         int b = 7;
         float c;
     }
}


More information about the Digitalmars-d-learn mailing list