C ++ does not allow you to overload functions, where the only difference in the signature of the function is that the object accepts the object and the other refers to the object. So something like:
void foo(int);
and
void foo(int&);
is not allowed.
You need to change the number and / or type of parameter.
In your case, the function accepting reference, you can force it to accept pointer, if you want to allow the function to change its argument.
source
share