I was wondering if it is necessary to put const in the parameters of a function and in the parameters to achieve const correctness.
My understanding is const correctness is a promise not to change the variable.
For example are:
bool operator==(const rational<T>& rat);
bool operator!=(const rational<T>& rat);
and
bool operator==(const rational<T>& rat) const;
bool operator!=(const rational<T>& rat) const;
equivalent?
I was thinking there were mainly because if you don't change the parameters, they you don't change anything in the class or are they different because you can change the values of the public/private members, but not passed in parameters.
Please correct my terminology if used incorrectly.