-2
雖然我纏着我的程序的每一個部分try代碼我不能讓這導致運行時錯誤(沒有任何其他細節)行:C++ - 「的std :: out_of_range」
"terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check Aborted"
,我不知道我應該做什麼。 該錯誤是由下面的代碼段引起的,因爲它似乎除了這些行之後:
.....
map<int, StaticObject*>::iterator mapPos2;
vector<StaticObject*, boost::pool_allocator<StaticObject*> >::iterator vecPos;
map<int, int>::iterator mapPos = userCountMap.begin();
mapPos2 = this->_cachedObjects.find(this->_lruQueue.at(mapPos->first)->getId());
vecPos = find(this->_lruQueue.begin(),this->_lruQueue.end(), this->_lruQueue.at(mapPos->first));
size -= this->_lruQueue.at(mapPos->first)->getSize();
_availableSpace += this->_lruQueue.at(mapPos->first)->getSize();
delete (*mapPos2).second;
this->_cachedObjects.erase(mapPos2);
this->_lruQueue.erase(vecPos);
............
和稍後:
map<int, int> userCountMap;
userCountMap.insert(make_pair(object->getId(),1)); ...
this->userCountMap[id]++; ...
this->userCountMap.clear(); ....
-1 WTH不清楚這個異常並跟蹤(調試)它拋出的點? –