#include <iostream>
#include <list>
#include <deque>
using namespace std;
int main(){
deque<int>s;
for (int i=0;i<6;)
{
s.push_front(++i);
}
list<int>k(s.rbegin(),s.rend());
return 0;
}
编译就是出错。有过来人知道为什么嘛? 我是VC6的
D:\temp\STLtest1\STLtest1.cpp(24) : error C2664: '__thiscall std::list<int,class std::allocator<int> >::std::list<int,class std::allocator<int> >(unsigned int,const int &,const class std::allocator<int> &)' : cannot convert parameter 1 from 'class std::reverse_iterator<class std::deque<int,class std::allocator<int> >::iterator,int,int &,int *,int>' to 'unsigned int'
我本意是将s逆序放到k里面