还在苦苦敲代码开发APP?你out啦! 试试积木搭建APP吧~

error C2664:...No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

来源:清泛原创     2016-08-29 16:59:59    人气:     我有话说( 0 人参与)

error C2664: &#39;__thiscall std::list<int,class std::allocator<int> >::std::list<int,class std::allocator<int> >(unsigned...

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::deque<int,class std::allocator<int> >::iterator' to 'unsigned int'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

#include <iostream>  
#include <list>  
#include <deque>  
using namespace std;  
void main()  
{       
     //Define a list that holds elements that are deques that hold ints  
     deque<int>   ideque(10,1);  
     list<int>  ilist(ideque.begin(),ideque.end());  
     for(list<int>::const_iterator itbegin=ilist.begin(),itend=ilist.end();itbegin!=itend;++itbegin)  
         cout<<*itbegin<<endl;  
}

解决方法:vc 6.0对模板库支持不够好,使用vs2010编译通过。

error C2664

注:本文为本站或本站会员原创优质内容,版权属于原作者及清泛网所有,
欢迎转载,转载时须注明版权并添加来源链接,谢谢合作! (编辑:admin)
分享到: