New enum features

Robert Fraser fraserofthenight at gmail.com
Mon Jan 7 20:32:19 PST 2008


Sean Kelly wrote:
> 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

I hope this isn't intentional behavior... if so, it's WAY too confusing, 
and should be changed.



More information about the Digitalmars-d mailing list