enum str = "abc"; vs string str = "abc";

Meta jared771 at gmail.com
Thu Jan 17 15:16:16 UTC 2019


On Thursday, 17 January 2019 at 06:00:09 UTC, Walter Bright wrote:
> That's true for arrays, but for strings the compiler will emit 
> only one string, and everything else will refer to that.

While we have your ear, Walter, what about an enum that is an 
array of strings? Will an enum array of strings with length N 
behave the same way as a single string and only emit those N 
strings once, or will a new array be allocated each time the enum 
is used?


More information about the Digitalmars-d mailing list