我有一个PROFESOR类此属性附加伤害的push_back的向量的对象
vector<int> hDisponibles;
如果我有这个类的一个载体
set<profesor> profesores;
我试试这个
set<profesor>::iterator itP;
itP = profesores.begin();
while (itP != profesores.end()){
(*itP).hDisponibles->push_back(0);
itP++;
}
但是这个错误
utils.cpp:138: error: passing ‘const std::vector<int, std::allocator<int> >’ as ‘this’ argument of ‘void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]’ discards qualifiers
什么是什么错误'hDisponibles' – 2012-01-03 22:26:30
请出示错误 – Lou 2012-01-03 22:27:05