On Wed, 25 Jul 2012 12:30:56 +0200, monarch_dodra <[email protected]> wrote:

I read TDPL back to back like 5 times before posting this, but it never mentions opCall. I just checked the index right now, it is not in there. Is this new?

Hardly. Once upon a time, in the bad old days, structs didn't have
constructors. In their stead, we used static opCall.

Then, many moons later, we got @disable this();, and now I sorta think
a struct default constructor should simply be syntactic sugar for

@disable this();

static typeof(this) opCall( ) {
    // body
}


I'm not completely sold, though. It feels a bit too much like magic.

--
Simen

Reply via email to