const methods()

Bill Baxter dnewsgroup at billbaxter.com
Tue Jan 23 18:52:50 PST 2007


Kristian Kilpi wrote:
> On Tue, 23 Jan 2007 18:15:14 +0200, James Dennett <jdennett at acm.org> wrote:

> Thanks (for not picking on me). Actually I have used C++ a lot and done 
> preeetty big projects with it. It's amazing that I hadn't noticed the 
> 'mutable' keyword during all these years. When I came across a situation 
> I described earlier in my example, the first thing I thought of was to 
> do a nonconst cast and be done with it. That is, C++ allows you to do 
> that. If nonconst casting had not been possible, then I would have 
> searched for different solution, and noticed that 'mutable' exists.

If you learned C++ pretty early on then it's not too surprising that you 
weren't aware of 'mutable'.  It was a fairly late addition.  I think the 
first copy of Stroustrup I bought did not have 'mutable'.

--bb



More information about the Digitalmars-d mailing list