ra1*_*170 4 c++ boost visual-studio-2010
我正在尝试重新编译应用程序,在visual studio 2005和visual studio 2008中使用警告级别4进行编译.由于错误(见下文)来自std:tr1,我认为存在一些冲突,但不确定如何修理.我的第一个想法是删除所有对boost的引用,但是后来我得到一个错误,它无法找到格式方法.所以这里有一个错误:(不确定它意味着什么)任何想法,建议,解决方案?谢谢!
编辑:刚开始时我看到一条消息:未知的编译器版本 - 请运行配置测试并报告结果
EDIT2:我认为导致此错误的一段代码:(更改为保护无辜)EDIT3:我更新了错误消息,即添加了更多...但是我得到了更多错误消息,例如这一个..所以有一个更大的问题/问题.
!m_someMap.insert( std::make_pair( "somestring", SomeClass::isTrue ) ).second
....
.....
inline bool isTrue ( const IDog & dog ) { return s.IsDogTrue(); }
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(197): error C2752: 'std::tr1::_Remove_reference<_Ty>' : more than one partial specialization matches the template argument list
1> with
1> [
1> _Ty=bool (__cdecl &)(const IDog &)
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtr1common(356): could be 'std::tr1::_Remove_reference<_Ty&&>'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtr1common(350): or 'std::tr1::_Remove_reference<_Ty&>'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(962) : see reference to class template instantiation 'std::tr1::remove_reference<_Ty>' being compiled
1> with
1> [
1> _Ty=bool (__cdecl &)(const IDog &)
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility(26) : see reference to class template instantiation 'std::tr1::decay<_Ty>' being compiled
1> with
1> [
1> _Ty=bool (__cdecl &)(const IDog &)
1> ]
1> C:\(PATH)\...(915) : see reference to class template instantiation 'std::tr1::_Unrefwrap<_Type>' being compiled
1> with
1> [
1> _Type=bool (__cdecl &)(const IDog &)
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(965): error C2528: 'abstract declarator' : pointer to reference is illegal
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(349): error C2528: 'type' : pointer to reference is illegal
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(967) : see reference to class template instantiation 'std::tr1::add_pointer<_Ty>' being compiled
1> with
1> [
1> _Ty=bool (__cdecl &)(const IDog &)
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(197): error C2752: 'std::tr1::_Remove_reference<_Ty>' : more than one partial specialization matches the template argument list
1> with
1> [
1> _Ty=bool (__cdecl &)(const char *,int,const char *,std::string &)
1> ]
Run Code Online (Sandbox Code Playgroud)
问题在于visual studio 2010,或者我应该说使用添加到visual studio 2010 tr1的其他模板,因此,std :: make_pair并不总是有效.改为配对<>,所有错误都神奇地消失了.
因此,如果VC2010中存在模板问题并使用std:make_pair,请将其更改为pair <>并指定模板参数.
| 归档时间: |
|
| 查看次数: |
7031 次 |
| 最近记录: |