我有一個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