Explicit default constructor for structs

Brian Schott briancschott at gmail.com
Wed Apr 9 09:59:54 PDT 2014


What would this do?

struct SomeStruct
{
     this(int i = 10)
     {
         this.i = i;
     }

     this(void)
     {
         this.i = 20;
     }

     int i;
}

auto s = SomeStruct();


More information about the Digitalmars-d mailing list