--- Comment #10 from Jonathan M Davis <> 2012-09-21 12:19:15 
PDT ---
It was my understanding that

@disable this();

was specifically the syntax to disable the init property. Certainly, trying to
disable init directly doesn't work as far as I can tell. And since structs
don't _have_ default constructors, I don't know what else

@disable this();

would be disabling (other than perhaps S(), which uses the init property
anyway, since there's no default consturctor).

The whole point is to be able disable init so that you can _never_ use it for
_anything_. You must _always_ directly initialize such a type (unless you
directly initialize it with void).

Yes, normally, T.init is the value that the type has before any constructor is
called, but if it's disabled, then it effectively does not exist, and it should
be impossible to use T.init _anywhere_. Construction should work the same with
any constructors that do exist (so the object state prior to construction is
the same as what T.init would have been had it existed), but it should be
impossible to default initialize such a type or to use it in any context which
would require default initialization, and it should be impossible to reference
that type's init in code anywhere. That's the whole point of disabling init,

@disable this();

is specifically for disabling init. It doesn't affect declared constructors
work, but it affects every other aspect of init.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to