A
Allerdyce.John
How can I emove an item in STL iterator without use the STL algorithm?
I know we can use stl erase, find_if to remove items from a STL vector
, but how can I do the same without using STL algorithm?
vector<int> srcVector;
vector<int> destVector;
for (vector<int>::iterator itr = srcVector; itr != srcVector; itr++) {
int i = (*itr);
// if i contains in destVector, remove that from both srcVector
and destVector
}
I know we can use stl erase, find_if to remove items from a STL vector
, but how can I do the same without using STL algorithm?
vector<int> srcVector;
vector<int> destVector;
for (vector<int>::iterator itr = srcVector; itr != srcVector; itr++) {
int i = (*itr);
// if i contains in destVector, remove that from both srcVector
and destVector
}