I wanted to swap two number using a template but why does this swap(x, y); give an error as an ambiguous call.
#include <iostream>
using namespace std;
template <class T>
void swap(T &a, T &b) {
T temp = a;
a = b;
b = temp;
}
int main () {
int x = 14;
int y = 7;
swap(x, y);
cout << x << y;
}