我想向量的在我的代码之类的函数的返回类型载体,函数返回类型在C++中
class SocketTransportClient{
void sendData(RMLInfoset *info){
vector<unsigned long>::iterator blockIterator;
vector<unsigned long> vectBlock=info->getRML(); // error : error C2440: 'initializing' : cannot convert from 'std::vector<_Ty>' to 'std::vector<_Ty>'
}
}
class RMLInfoset {
vector<unsigned int> RMLInfoset::getRML(){
return vectDataBlock;
}
}
,但它显示一个错误的std :: vector的< _Ty>‘到'无法从转换’的std ::矢量< _Ty>' 所以请任何一个可以帮助我,谢谢 。
这部作品IDEONE:http://ideone.com/dIJG3 – James
上次编辑后,我会发布一个答案,但格雷格Hewgill已是不错,足以做到这一点。阅读他的答案。 :) – James