error C3861: back_inserter : 找不到标识符(+补充新问题)
2016-08-16 21:45
627 查看
http://blog.csdn.net/swazer_z/article/details/7389455
isual Studio 2010中的VC++对C++0x提供了很多支持,很多标准也与C++0x接轨。这样做的好处是很多的,但同时也会导致以前一些不符合C++0x规范的代码无法像原来那样工作。
问题:error C3861: 'back_inserter': identifier not found
解决方法:#include ﹤iterator﹥
问题在于,back_inserter()在没有include ﹤iterator﹥的情况下被使用。C++标准库的headers会通过某种未定义的方式将其他headers包括进来。……VC9 SP1下,include﹤algorithm﹥顺带的就包括了﹤iterator﹥,但在VC10下需要单独写明。
////////
问题2: error C2664: 'std::vector﹤_Ty﹥::_Inside' : cannot convert parameter 1 from 'IUnknown **' to 'const ATL::CComPtr﹤T﹥ *'
解决方法:使用CAdapt
标准容器禁止其元素将运算符的address-of过载。CComPtr将运算符的address-of过载,导致 vector﹤CComPtr﹤T﹥﹥被禁止。这是因为,在VC9 SP1中,vector并在push_back()中使用不使用运算符的address-of,但在VC10 Beta 1中是使用的。
解决方法就是使用﹤atlcomcli.h﹥的CAdapt。……
问题3: error C2662: 'NamedNumber::change_name' : cannot convert 'this' pointer from 'const NamedNumber' to 'NamedNumber &'
解决方法:Respect set Immutability (尊重set的不变性)
问题4:Specializing stdext::hash_compare
(如果你为你的type使用非标准话的 ﹤hash_set﹥或﹤hash_map﹥,以及特别的stdext::hash_compare,那你会发现这里没法儿用了,因为它们被移到了命名空间下。 ……)
解决方法:使用 ﹤unordered_set﹥ 或﹤unordered_map﹥
isual Studio 2010中的VC++对C++0x提供了很多支持,很多标准也与C++0x接轨。这样做的好处是很多的,但同时也会导致以前一些不符合C++0x规范的代码无法像原来那样工作。
问题:error C3861: 'back_inserter': identifier not found
解决方法:#include ﹤iterator﹥
问题在于,back_inserter()在没有include ﹤iterator﹥的情况下被使用。C++标准库的headers会通过某种未定义的方式将其他headers包括进来。……VC9 SP1下,include﹤algorithm﹥顺带的就包括了﹤iterator﹥,但在VC10下需要单独写明。
////////
问题2: error C2664: 'std::vector﹤_Ty﹥::_Inside' : cannot convert parameter 1 from 'IUnknown **' to 'const ATL::CComPtr﹤T﹥ *'
解决方法:使用CAdapt
标准容器禁止其元素将运算符的address-of过载。CComPtr将运算符的address-of过载,导致 vector﹤CComPtr﹤T﹥﹥被禁止。这是因为,在VC9 SP1中,vector并在push_back()中使用不使用运算符的address-of,但在VC10 Beta 1中是使用的。
解决方法就是使用﹤atlcomcli.h﹥的CAdapt。……
问题3: error C2662: 'NamedNumber::change_name' : cannot convert 'this' pointer from 'const NamedNumber' to 'NamedNumber &'
解决方法:Respect set Immutability (尊重set的不变性)
问题4:Specializing stdext::hash_compare
(如果你为你的type使用非标准话的 ﹤hash_set﹥或﹤hash_map﹥,以及特别的stdext::hash_compare,那你会发现这里没法儿用了,因为它们被移到了命名空间下。 ……)
解决方法:使用 ﹤unordered_set﹥ 或﹤unordered_map﹥
相关文章推荐
- error C3861: back_inserter : 找不到标识符(+补充新问题)
- HM低版本用VS2012打开编译错误问题error C3861: “mem_fun”: 找不到标识符
- 解决“error C3861: “pcap_findalldevs_ex”: 找不到标识符”以及“error C2065: “PCAP_SRC_IF_STRING”: 未声明的标识符”问题
- 编译错误之error C3861: “getline”: 找不到标识符的问题
- C++问题-UniqueAppObject.cpp(147): error C3861: “GUXClientInit”: 找不到标识符
- 【解决方法】调试出现:error C3861: “max”,“min”: 找不到标识符。
- 编译错误之error C3861: “getline”: 找不到标识符
- error C3861: “L”: 找不到标识符
- error C3861: identifier not found | 找不到标识符
- error C3861: “mciSendString”: 找不到标识符 的解决
- error c3861 :"_T":找不到标识符
- error c3861 :"_T":找不到标识符
- error C3861: “cvCalcPGH”: 找不到标识符
- 在VS2010中出现 error C3861: “snprintf”: 找不到标识符
- 错误 1 error C3861: “AfxMessageBox”: 找不到标识符 e:\c++\test\udptest20120901\udptest20120901\udptest2012090
- C++ 错误 2 error C3861: “__cpuidex”: 找不到标识符
- : error C3861: “Sleep”: 找不到标识符
- OpenCV2.0在VS2010配置中出现问题的解决方法 VS2010 C++中出现常见问题:back_inserter
- VS2010常见问题: 'back_inserter': identifier not found
- error C3861: “glBlendEquation”: 找不到标识符