主题:容器初始化问题
#include<iostream>
#include<vector>
#include<list>
using namespace std;
template<class T>
void print(T first,T end)
{
T ix;
for(ix=first;ix!=end;ix++)
{
cout<<*ix<<" ";
}
cout<<endl;
}
int main(void)
{
vector<int> ivec;
vector<int>::size_type ix=0;
for(;ix!=10;ix++)
{
ivec.push_back(ix);
}
print(ivec.begin(),ivec.end());
list<int> ilist(ivec.begin(),ivec.end());
print(ilist.begin(),ilist.end());
vector<int> ivec1(ilist.begin(),ilist.end());//1
print(ivec1.begin(),ivec1.end());//2
return 0;
}为何//1处错误,请大虾指教!谢谢