C++函数模板例子
//C++函数模板实例
#include <iostream>
template <class Any>
void Swap(Any &a, Any &b);
int main()
{
using namespace std;
double i = 10.123, j = 20.124;
Swap(i, j);
cout << "i, j = " << i << " ," << j << endl;
return 0;
}
template <class Any>
void Swap(Any & a, Any & b)
{
Any temp;
temp = a;
a = b;
b = temp;
}