New enum features

Sean Kelly sean at f4.ca
Mon Jan 7 15:37:44 PST 2008


Sivo Schilling wrote:
> Sean Kelly Wrote:
> 
>> Sivo Schilling wrote:
>>> Is there a difference between an anonymous enum member and a manifest
>>> constant considering a string?
>> I wouldn't expect so.  In fact I wonder if it shouldn't be a compile 
>> error to pass a manifest constant string to a run-time function.  How 
>> can you take the address of something with no storage?
> 
> Why should it a compile time error ? From the specs I guess
> that the enhanced enum feature acts as "#define" in C/C++.

Oh good point.  So storage is provided for manifest string constants 
which are actually used in the program, just like string literals.  That 
makes sense.  But I do still consider the brackets vs. no brackets issue 
to be a bug.  Both should print the string successfully then.


Sean



More information about the Digitalmars-d mailing list