PhobosWatch: manifest => enum

Sean Kelly sean at f4.ca
Fri Jan 4 13:39:23 PST 2008


Oskar Linde wrote:
> In D1.0, when 
> something is *constant*, you simply declare it as const:
> 
> struct T {
>     const int a = 5;
>     int b;
> }
> 
> static assert(T.sizeof == int.sizeof);
> 
> No need to stop and think. In D2.0 it seems like you have to go through: 
> "Hmm, this value will never change. I will mark it as const.... no wait 
> invariant... or maybe manifest constant using the enumeration hack?"

Yup.  This is what I don't like about the current design as well.  What 
was your orthogonal const proposal again?  I've lost it amid the flood 
of const posts.


Sean



More information about the Digitalmars-d mailing list