“memcpy”: 不能将参数 二 从“std:Vector_iterator”转换为“const void *”
“memcpy”: 不能将参数 2 从“std::_Vector_iterator<_Ty,_Alloc>”转换为“const void *”
“memcpy”: 不能将参数 2 从“std::_Vector_iterator<_Ty,_Alloc>”转换为“const void *”
1> with
1> [
1> _Ty=RecvFile,
1> _Alloc=std::allocator<RecvFile>
1> ]
1> 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
求解决方案
------解决方案--------------------
“memcpy”: 不能将参数 2 从“std::_Vector_iterator<_Ty,_Alloc>”转换为“const void *”
1> with
1> [
1> _Ty=RecvFile,
1> _Alloc=std::allocator<RecvFile>
1> ]
1> 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
求解决方案
------解决方案--------------------
- C/C++ code
std::vector<T> vt; if (!vt.empty()) { CopyMemory(&vt[0], vt.size(),...); }
------解决方案--------------------
怎么操作的?
- C/C++ code
int i; std::vector<int> vt; vt.push_back(1); std::vector<int>::iterator it; for (it = vt.begin();it++;it != vt.end() ) memcpy(&i,it,sizeof(int));
------解决方案--------------------
有道理