I want to make a function which moves items from one STL list to another if they match a certain condition.
This code is not the way to do it. The iterator will most lik
Another attempt:
for(std::list::iterator it = myList.begin(); it != myList.end; ) { std::list::iterator eraseiter = it; ++it; if(myCondition(*eraseiter)) { myOtherList.push_back(*eraseiter); myList.erase(eraseiter); } }