On 04/09/2014 04:59 PM, Benjamin Thaut wrote:

Instead I would really love to have a explicit default constructor. E.g.
it could look like this (alternative a new keyword "explicit" could be
introduced, but introduction of new keywords is usually avoided if
possible, AFAIK):

struct Foo
{
   this(void)
   {
     // do stuff here
   }
}

Why not just:

struct Foo{
    this(){
        // do stuff here
    }
}

void main(){
    Foo foo1; // error, no init value
    auto foo2=Foo(); // ok
}

Reply via email to