I basically had a function like this:
Code:
list<Coordinates>::iterator partition_segment(list<Coordinates>& mList, list<Coordinates>::iterator it){
list<Coordinates> tempList;
double xPos = it->get_x();
++it;
double nextXPos = it->get_x();
// Do stuff with my data here
// Populate my temp list:
tempList.push_back(aCoordinate);
tempList.push_back(aCoordinate2);
tempList.push_back(aCoordinate3);
mList.splice(it, tempList);
return it;
}
This function was called in main like so:
Code:
for(int i = 0; i < numLoops; i++){
list<Coordinate>::iterator pos = aList.begin();
while(pos != aList.end()){
pos = partition_segment(aList, pos);
}
}
it works fine now, and I undid so many things that I won't know where the problem was now.