Whats going on with this?

Steven Schveighoffer schveiguy at gmail.com
Sat Oct 3 00:15:02 UTC 2020


On 10/2/20 7:28 PM, claptrap wrote:

> Why would putting in the writeln cause it to fail? Is it maybe trying to 
> create the foo at compile time?
> 

Yes, it is. Any static initialization of static variables happens at 
compile-time.

https://dlang.org/spec/declaration.html#global_static_init

-Steve


More information about the Digitalmars-d-learn mailing list