template<class T>
void swap(T &a, T &b)
{
T t;
t = a;
a = b;
b = t;
}
replace
void swap(int &a, int &b)
{
int t;
t = a;
a = b;
b = t;
}
This is the simplest example I could come up with, but there should be many other complex functions. Should I use all the methods that I can write, if possible?
Any flaws to do this?
thank.
source
share