"Semi-const" methods?

Magnus Lie Hetland magnus at hetland.org
Sun Mar 13 15:45:58 PDT 2011


On 2011-03-13 23:32:34 +0100, Magnus Lie Hetland said:

> (Still open to schooling on the design part of this, though. Perhaps 
> declaring a method as const is no good when it's not *really* const? 
> For now, I'm just doing it to check that I don't inadvertently change 
> things I don't want to change.)

Actually, I have a local (recursive) traversal function in the method I 
was talking about. Ended up not declaring the method as const, but 
declaring the argument of the traversal function as const. No 
misleading const declarations "outside", and I get the automatic checks 
that I want.

-- 
Magnus Lie Hetland
http://hetland.org



More information about the Digitalmars-d-learn mailing list