On Thu, 11 Dec 2008 02:13:58 +0300, Weed <[EMAIL PROTECTED]> wrote:
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 MyCla
Jarrett Billingsley пишет:
On Wed, Dec 10, 2008 at 5:31 PM, Weed <[EMAIL PROTECTED]> wrote:
code:
import std.stdio;
class MyClass
{
invariant uint a = 0;
}
void main()
{
static MyClass c = new MyClass;
writeln( c.a );
}
It's not the class member that wants static initialization, it
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 =
Reply to Jarrett,
On Wed, Dec 10, 2008 at 5:31 PM, Weed <[EMAIL PROTECTED]> wrote:
code:
import std.stdio;
class MyClass
{
invariant uint a = 0;
}
void main()
{
static MyClass c = new MyClass;
writeln( c.a );
}
It's not the class member that wants static initialization, it's your
variable d
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
On Wed, Dec 10, 2008 at 5:31 PM, Weed <[EMAIL PROTECTED]> wrote:
> code:
>
> import std.stdio;
>
> class MyClass
> {
>invariant uint a = 0;
> }
>
> void main()
> {
>static MyClass c = new MyClass;
>writeln( c.a );
> }
It's not the class member that wants static initialization, it's you
code:
import std.stdio;
class MyClass
{
invariant uint a = 0;
}
void main()
{
static MyClass c = new MyClass;
writeln( c.a );
}
moved from digitalmars.D
> Re: static initialization questionDigital Mars
> Benjamin Shropshire ([EMAIL PROTECTED]) 2008/12/10 16:46
> Reply to Weed,
>
>> why I can not initialize static variable this way:
>>
>> static MyClass c = new MyClass;
>>
&