Hi, I am reading the const function definition part in Deitel book, it
says :
Defining as const a member function that calls a non-const member
function of the class on the same instance of the class is a syntax
error.
what does "on the same instance of the class" mean? if I have a class
like the following:
class T{
private:
int x;
public:
int getX() const { return x; }
};
here, getX is defined as const, but it access the non-const member x,
and it is legal. so what Deitel mean by saying above statement?