Yet another const system - for everyone to enjoy

Alex Burton alexibu at mac.com
Thu Sep 13 23:07:45 PDT 2007


James Dennett Wrote:

> Alex Burton wrote:
> > I wrote myself a piece of c++ code that proves how useless c++ const is.
> 
> I'll call it there.
> 
> No piece of code you write can do any such thing; it can only
> show that const is useless in that piece of code, or at best
> show that const has some limitations.
> 
> A compiler can't enforce logical constness perfectly without
> incorporating a full-blown language for correctness proofs,
> unless it has very unpleasant restrictions in its language.
> That doesn't make const or similar "useless".  It just means
> you can't expect a silver bullet for ensuring correctness of
> code; it's still necessary to use human intelligence and good
> design as well as tools.
> 
> -- James

Agreed. Useless it is not.
That was an exaggeration, in the context of my previous arguments against transitive const.



More information about the Digitalmars-d mailing list