for (auto iter = dlQueue.cbegin(); iter != dlQueue.cend(); ++iter)
{
// reference to the current element in the container
if (*iter.id == listid)
{
*iter.stall = newstall & 0xFFFFFFF;
}
}
當我解引用iter引用的對象時,我將能夠檢查對象的狀態;即id。或者這隻會給我一個迭代器的回報。當解引用迭代器時,這是有效的
我不能去:
iter -> id
DlQueue是出隊。
如果您要修改'* iter',則不能使用'cbegin'和'cend'。 – chris
@TheBlueCat:'* iter.stall = newstall&0xFFFFFFF;'看起來像對我的修改。 –
@SteveJessop對,對不起。我沒有讀最後一行。 – TheBlueCat