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);
编译通过。