Andrej Mitrovic wrote:
On 4/6/12, Piotr Szturmaj<bncr...@jadamspam.pl>  wrote:
struct Author { string name; }

Also, let's not forget the glaring limitation of structs that almost
everyone has ran into: you can't define a default ctor.

Static opCall() should do the trick:

struct Author
{
    string name;
    static Author opCall()
    {
        Author a;
        a.name = "empty";
        return a;
    }
}

enum a = Author();
pragma(msg, a.name);

Reply via email to