C++ iterators problem
- by qwead
I'm working with iterators on C++ and I'm having some trouble here. It says "Debug Assertion Failed" on expression (this-_Has_container()) on line interIterator++.
Distance list is a vector< vector< DistanceNode . What I'm I doing wrong?
vector< vector<DistanceNode> >::iterator externIterator = distanceList.begin();
while (externIterator != distanceList.end()) {
vector<DistanceNode>::iterator interIterator = externIterator->begin();
while (interIterator != externIterator->end()){
if (interIterator->getReference() == tmp){
//remove element pointed by interIterator
externIterator->erase(interIterator);
} // if
interIterator++;
} // while
externIterator++;
} // while