Not sure what the problem is..
$ g++ test2.C test2.C: In function 'int main()': test2.C:25: error: call of overloaded 'swap(int&, int&)' is ambiguous test2.C:8: note: candidates are: void swap(T&, T&) [with T = int] /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:92: note: void std::swap(_Tp&, _Tp&) [with _Tp = int]
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
template <class T>
inline void swap(T& i, T& j) {
T temp = i; i = j; j = temp;
}
main() {
int m,n;
cout << "Enter integer :";
cin >> m;
cout << "Enter integer :";
cin >> n;
cout << m << "," << n << endl;
swap(m,n);
cout << m << "," << n << endl;
}