Are static variables available to other static variables?

Dennis dkorpel at gmail.com
Fri Apr 12 10:56:09 UTC 2019


On Friday, 12 April 2019 at 10:49:19 UTC, Jamie wrote:
> 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?

Add `const` or `immutable` to A and it will work.
I don't know why B can't be initialized with A's initial value if 
A is mutable, but there's probably a rationale for that.


More information about the Digitalmars-d-learn mailing list