Latest const expansion

Janice Caron caron800 at googlemail.com
Tue Sep 11 15:58:50 PDT 2007


On 9/11/07, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
> So for that reason another
> keyword is preferable I think.  Like 'final'.  Or maybe headconst or
> 'hconst'.

We've had the keyword final for some time in D2.0, specifically for
the purpose of head-constness, so if it's deemed that we need it,
final would be as good a keyword as any.

But do we need it? Is there a need for head const at all?

Walter seems to have concluded that it's not needed. And every use
case I can think of could be done by other means, so I think I agree.

In every single circumstance I can think of,
headconst(T) x;

could simply be replaced by
T x;

and nothing would fall over. What is gained by the head-constness?
It's totally local.



More information about the Digitalmars-d mailing list