Am 09.04.2014 20:33, schrieb Timon Gehr:
On 04/09/2014 04:59 PM, Benjamin Thaut wrote:
Why not just:
struct Foo{
this(){
// do stuff here
}
}
void main(){
Foo foo1; // error, no init value
auto foo2=Foo(); // ok
}
Because then the user might think, that the default constructor gets called implicitly by the compiler. Just like in C++. But as that is not the case the syntax should be different to indicate that a struct might still be instaniated just using T.init.
Kind Regards Benjamin Thaut
