The problem with const proposals

Janice Caron caron800 at googlemail.com
Fri Dec 7 14:38:12 PST 2007


On 12/7/07, Jason House <jason.james.house at gmail.com> wrote:
> I'm not sure where axiom 2 comes from.

But it's certainly a desirable one. I'd prioritise axiom 2 any day.

Not happy with type T? Well, wrap it in a struct, add a few functions,
and viola - a new type that's just like a T, only better in whatever
ways you care to code. It's a good axiom.

...and it impacts tail-constness, which is why Walter listed it in
this thread. In order to comply with the axiom, it must be possible to
make

    tailconst( struct { T })

behave like

    struct { tailconst(T) }

and that's something which has not been addressed by any syntax
proposal so far, /except/ for Andrei's TailConst!() template.

...which is one reason why I like the template idea.



More information about the Digitalmars-d mailing list