使用STLPORT debug模式时遭遇error C2664错误,无法将Dbg_Iter转为指定的类型

d:/cameraobject/seurityinfo/collectionhelper.h(350): error C2664: 'Init': cannot convert parameter 1 from 'dbg_iter ' to 'tagVARIANT *'
    No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    ....

错误发生在这一行:

HRESULT hr = pEnum->Init(mCollect.begin(), mCollect.end(), NULL,AtlFlagCopy);

mCollect是一个vector mCollect;

到STLPort 网站一看http://www.stlport.org/doc/debug_mode.html

头一条啊

  • Application code using T* to store vector::iterator would not compile in debug mode. Such code should be fixed - the standard does not specify vector::iterator, so different implementations can use different types for it.
  • 大概就是说,保存vector::iterator在调试模式将不会编译通过.C++标准没有定义vector::iterator。不同的实现可能就不同的类型。没办法了,不让保存就先取值,再取地址

    HRESULT hr = pEnum->Init(&*(mCollect.begin()), &(*mCollect.end()), NULL,AtlFlagCopy);

    编译通过。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值