struct init property

Namespace rswhite4 at googlemail.com
Thu Aug 23 11:44:17 PDT 2012


It would be great if you could declare your own .init as you can 
atm with "new" (http://dlang.org/class.html#allocators).

For example:

class Foo {
public:
     init() {
         this = new typeof(this)();
     }
}

So you could avoid a null declaration by default. :)


More information about the Digitalmars-d-learn mailing list