"Charles Keepax" <s9******@sms.ed.ac.uk> wrote in message
news:bf**********@scotsman.ed.ac.uk...
Just a little quick question what is the effect of putting a const after
a member function definition.
Little quick answer :-)
The function does not modify the state of the object/class..
There are two camps on what that implies -
bitwise constness or abstract state constness.
Bitwise constness implies that no member variable gets modified.
For abstract constness consider a class
class A{
public :
void copy () ; // changes what p points to, not p..hence not const
private:
char *p;
};
Even if there is bitwise constness ( p unchanged) but if the contents of
what p points to get changed then
it is not abstract state constness.
--
With best wishes
J.Schafer