一个overload的错误
#include <iostream>
using namespace std;
template <class T>
void swap(T& var1,T& var2)
{
T temp;
temp=var1;
var1=var2;
var2=temp;
}
void main()
{
int i=1;
int j=2;
swap(i,j);
cout<<i<<endl<<j<<endl;
}
//这样的话会有两个编译错误,除非把开头两句改为
#include <iostream.h>
不要using namespace std;
该怎么解决?