What is the difference betweeen something like this
friend Circle copy(const Circle &);
and something like this
friend
Circle copy(Circle&) const;
makes the function const
itself. This can only be used for member functions of a class/struct.
Making a member function const
means that
const
object(const
objects can only call const
functions). Non-const objects can also call a const
function.Now consider the next one:
Circle copy(const Circle &);
while this one means that the parameter passed cannot be changed within the function. It may or may not be a member function of the class.
NOTE: It is possible to overload a function in such a way to have a const
and non-const version of the same function.