64,683
社区成员
发帖
与我相关
我的任务
分享
template<class T>
void traverse(const vector<T>& vt)
{
for(vector<T>::const_iterator it = vt.begin(); it!=vt.end(); it++)
{
cout<<*it<<endl;
}
}
template<class T>
void traverse(const basic_string<T>& vt)
{
for(basic_string<T>::const_iterator it = vt.begin(); it!=vt.end(); it++)
{
cout<<*it<<endl;
}
}
template<class T>
void traverse(const T& t)
{
for(T::iterator it = t.begin(); it!=t.end(); it++)
{
cout<<*it<<endl;
}
}
template<class T>
void traverse(const T& t)
{
for(const auto& it :t )
{
cout<<it<<endl;
}
}