#include <iostream>
#include <vector>
using namespace std;
//template <class T>
template <typename T>//typename是为了避免class混淆
T sum(T a, T b)//函数模板
{
return a+b;
}
int main(void)
{
cout<<sum(3,5)<<endl;
cout<<sum(3.3,5.0)<<endl;
//迭代器
vector<string> vec;
vec.push_back("zs");
vector<string>::iterator i = vec.begin();//i的数据类型死vector<string>
for(;i != vec.end(); i++)
{
cout<<*i<<endl;
}
return 0;
}