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

Victor Porton porton at narod.ru
Wed Jan 16 18:21:29 UTC 2019


What is more space efficient:

enum str = "safjkdfjksdlfkdsj";

or

string str = "safjkdfjksdlfkdsj";

?

with the first code fragment, won't the string be re-created and 
re-inserted into the object file one time whenever str is used, 
rather than once?

What of the two you would recommend?


More information about the Digitalmars-d mailing list