On Mon, 12 Sep 2011 20:44:26 -0400, Timon Gehr <[email protected]> wrote:

Yes, that is what I meant. It already does that:

struct S{
     this() @disable;
}

class C{
     S s;
this(){} // Error: constructor tt.C.this field s must be initialized in constructor
}

The only thing that needs to be changed is that classes containing non-default-constructible uninitialized fields can be default constructed if they provide a default constructor.

Oh wow, this really is a no-brainer.  Walter?

At least there should be an enhancement report.

-Steve

Reply via email to