0
我試圖遍歷對的載體,我需要通過這樣做是爲了增加對中的一個元素。增量值
for (std::vector<std::pair<Process *, int> >::const_iterator it = process.begin(); it != process.end(); it++) {
if (queue.size() == 0)
break;
while (queue.size() > 0 && it->second < threadsPerProcess * 2) {
it->first->send(queue.front());
queue.pop_front();
++it->second; // value i am trying to increment
}
}
可能有人告訴我,我在做什麼錯誤?