Is enum static?

Jonathan M Davis jmdavisProg at gmx.com
Tue Aug 20 20:15:14 PDT 2013


On Wednesday, August 21, 2013 02:13:02 Dicebot wrote:
> Sure. But array literals won't get static in @system code. That
> is exactly what I am speaking about - pursuing correctness of
> @safe severely harms @system. It never was advertised that way.
> Was it meant to?

Array literals wouldn't become static in @safe code either. There only case 
I'm aware of where an array literal effectively becomes static is when directly 
initializing a static array. And even if there are more cases, none of them 
would have anything to do with safety. The only time that the compiler would 
do it would be if it was able to determine that avoiding the allocation wolud 
be semantically identical (aside from the lack of allocation).

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list