Const sucks

Bruce Adams tortoise_74 at yeah.who.co.uk
Tue Sep 11 14:20:27 PDT 2007


Nathan Reed Wrote:

> Janice Caron wrote:
> > I want to be able to *express the idea* that the value I am declaring
> > shall never change. To my mind:
> > 
> > const int NUM_DAYS_IN_WEEK = 7;
> > 
> > successfully expresses that idea, and frankly, I whether or not
> > NUM_DAYS_IN_WEEK consumes memory should not be my call. That is an
> > implementation detail, and should be the compiler's problem, not mine.
> 
> Agree.
> 
> Thanks,
> Nathan Reed

Already agreed on another thread but worth every extra vote.



More information about the Digitalmars-d mailing list