Do strings with enum allocate at usage point?

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 18 03:36:32 PDT 2015


On Wednesday, 18 March 2015 at 07:58:58 UTC, Daniel Kozák wrote:
> But is it document somewhere by spec? Or it is just an 
> optimalization
> which could be remove at some point?

I cannot find it in the specification, but it is guaranteed. It's 
a benefit we get from the immutability of strings. AFAIK the 
compiler will even merge identical string literals, even when 
they appear in different modules.


More information about the Digitalmars-d-learn mailing list