我在我的头文件中的下列减速VC++矢量迭代器初始化
// 3D Vector
typedef struct tagV3D /*: V2D*/ {
union {
struct {
double x;
double y;
double z;
};
struct {
struct tagV2D v2d_;
};
};
} V3D, TVec3D, *PVec3D;
现在我有我的cpp文件中的方法
bool InsertSelfIntersectionVertexes(vector<PVec3D> &avtxlst) {
PVec3D vtx;
int iI;
...
vtx = new TVec3D;
*vtx = v;
PVec3D* p= avtxlst.begin() + iI + 1;
avtxlst.insert(p, vtx);
...
}
我得到以下尝试编译代码中的错误
error C2440: 'initializing' : cannot convert from 'std::_Vector_iterator<_Ty,_Alloc>' to 'PVec3D *'
and
error C2664: 'std::_Vector_iterator<_Ty,_Alloc> std::vector<_Ty>::insert(std::_Vector_const_iterator<_Ty,_Alloc>,const _Ty &)' : cannot convert parameter 1 from 'PVec3D' to 'std::_Vector_const_iterator<_Ty,_Alloc>'
我该如何解决这个问题?
下面的代码工作正常与VC6,当迁移到VS 2008出现了错误。
这是为什么?
欣赏任何答案
为什么* PVec3D不是PVec3D,那就是没有明星? – 2012-01-13 10:16:22