Are static variables available to other static variables?

Jamie notme at gmail.com
Fri Apr 12 10:49:19 UTC 2019


I was trying to declare a static variable dependent on another 
static variable, but it didn't work. Are static variables not 
known to other static variables at compile time?

void main()
{	
	C c = new C();
}

class C
{
     static size_t A = 2;
     static size_t B = 2^^A; // A is not known at compile time
}



More information about the Digitalmars-d-learn mailing list