struct init property
Jonathan M Davis
jmdavisProg at gmx.com
Thu Aug 23 10:23:11 PDT 2012
On Thursday, August 23, 2012 19:15:16 nocide wrote:
> 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?
The init property is defined by what you directly initialize the struct's
member variables to.
struct S
{
int i = 7;
string s = "hello";
}
S.init has a value of 7 for i and "hello" for s.
Unfortunately, I don't believe that declaring an init function or property is
currently disallowed, but if it affects S.init, it's a bug.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list