PhobosWatch: manifest => enum
Jason House
jason.james.house at gmail.com
Fri Jan 4 14:54:50 PST 2008
Sean Kelly Wrote:
> 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.
I looked his proposal up earlier today. It's at http://www.csc.kth.se/~ol/const.pdf
I almost posted asking how D 2.009 "const" differs from his "in" and D 2.009 "invariant" differs from his "const". I thought I understood, but then I noticed him use "const in" and "const const(T)"...
More information about the Digitalmars-d
mailing list