On 11/29/2012 4:47 AM, monarch_dodra wrote:
On Sunday, 25 November 2012 at 16:47:08 UTC, Dmitry Olshansky wrote:
Thoughts?
I don't know about "killing" T(), but I think there *needs* to be an
(easy) mechanism to declare ***and*** run-time initialize an object, in
a single and comprehensive line.
I had proposed something 2 months ago here:
http://forum.dlang.org/thread/bvuquzwfykiytdwsq...@forum.dlang.org
The proposal wasn't perfect, but still. We need to figure something out...
The original idea is that there should be *no such thing* as default
construction of a struct as being anything other than T.init. The
default construction of a struct should be a compile time creature, not
a runtime one.
Any methods or workarounds to try and make T() produce something
different from T.init is bad D practice. The compiler tries to
statically head them off, but probably should do a better job of that.