is my code to get CTFE instantiated object valid D ?

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 28 22:43:31 PDT 2016


On Sunday, 29 May 2016 at 05:35:33 UTC, Mike Parker wrote:

> Well then, this completely breaks my understanding of variable 
> scope.

OK, I see now at [1] the following:

" Immutable data doesn't have synchronization problems, so the 
compiler doesn't place it in TLS."

I've read that page more than once, but I had forgotten this bit. 
Still, I don't see anything there about const. I would not expect 
const variables to behave the same way, given the weaker 
guarantee about modification. But if they are intended to behave 
that way, then, IMO, it should not be possible to reinitialize 
them in a static constructor.

https://dlang.org/migrate-to-shared.html


More information about the Digitalmars-d-learn mailing list