template <typename T>
void swap(T & a, T & b);
int main()
{
int a = 10;
int b = 12;
swap(a, b);
return 0;
}
template <typename T>
void swap(T & a, T & b)
{
T temp;
temp = a;
a = b;
b = temp;
}
14 11 C:\Users\A-technics\Desktop\main.cpp [Error] call of overloaded 'swap(int&, int&)' is ambiguous
14 11 C:\Users\A-technics\Desktop\main.cpp [Note] candidates are:
8 6 C:\Users\A-technics\Desktop\main.cpp [Note] void swap(T&, T&) [with T = int]