The tailconst problem (and suggestions for solution)

Janice Caron caron800 at googlemail.com
Fri Dec 7 07:26:45 PST 2007


On Dec 7, 2007 3:12 PM, Craig Black <cblack at ara.com> wrote:
> What I don't understand is
> why.
>
> const(C) c;
>
> Means that the reference is constant.

Look at it another way. You'd want

    const T t;
    t = something;

to fail, always - regardless of the type of T. It has to be true when
T is a class, because it has to be true for everything.

Remember, the two new (vastly simplified, but brilliant) rules are:
(1) const type identifer; means the same thing as const(type) identifier;
(2) Everything inside the brackets is const



More information about the Digitalmars-d mailing list