Hmm - about manifest/enum
Walter Bright
newshound1 at digitalmars.com
Tue Jan 1 02:31:18 PST 2008
Janice Caron wrote:
> It is. I know that's not immediately obvious, but if you follow
> through all the arguments (which I don't want to repeat coz they're
> long and complicated) you eventually have to conclude it can't be
> done.
The best analogy I have come up with is attempting to make a square out
of 4 line segments, 1 of which is a different length than the other 3.
No matter how you try and fit the segments together, there's a gap
somewhere or an angle that isn't 90 degrees.
That's what always happened when we tried to make an exception to the
const rules. There was always a gap or a bad angle popping up somewhere
ugly. C++ made special case exceptions to the way its const worked, ones
that seemed to make sense at the time, but the odd problems kept
cropping up, and I've been told by metaprogramming experts that the
whole system is coming unglued with advanced metaprogramming attempts.
That's why the new const regime is 'pure' in that there are no
exceptions to the rules. It's end-to-end straightforward.
More information about the Digitalmars-d
mailing list