Denis Koroskin пишет:
On Thu, 11 Dec 2008 01:31:32 +0300, Weed <[EMAIL PROTECTED]> wrote:
But my class does not contain data that need initialization and can be
created
in compile time
code:
import std.stdio;
class MyClass
{
invariant uint a = 0;
}
void main()
{
static MyClass c = new MyClass;
writeln( c.a );
}
There is a memory allocation that may occurs at run time only.
In C++ analogous construction means creation of uninitialized static
pointer (in compile time) and it's initialization at first execution
this line in the function.
Why D does not behave that way on this construction?