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

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Jan 16 19:20:39 UTC 2019


On Wed, Jan 16, 2019 at 02:10:02PM -0500, Steven Schveighoffer via Digitalmars-d wrote:
> On 1/16/19 1:50 PM, H. S. Teoh wrote:
> > Also, you may have no choice but to use an enum if `str` is
> > referenced by compile-time code, since static globals would not be
> > readable at compile-time.
> 
> Not sure what you mean, this should work.
> 
> Only immutable globals that aren't initialized until runtime can't be
> used.

Ahh, I see.  I stand corrected. :-)


T

-- 
Verbing weirds language. -- Calvin (& Hobbes)


More information about the Digitalmars-d mailing list