Hi all, I have the following simple example of function overload, but I can not get it to run cause I get the following error message:
error: call of overloaded 'swap(double& , double&)' is ambiguous. any help will be appreciated.
There is a std::swap and your swap. because of the usingnamespace std; the compiler doesn't know which to use. Try ::swap( x, y); to tell it to use your swap.
thank you CodeMonkey, you are 100% right, I changed the swap() to Swap() and it did not complain. Sorry for this stupid question, I am just a beginner :(.