amanyasin
Technical User
- Feb 7, 2003
- 28
Hi,
Dear all,
On each iteration in Vector , i want to deduce one element and delete it. then pass remaining vector to my function.
so, problem is this. it is not erasing the specific vector
But it is giving an error.
i tried to find an error but i am fail,
if i remove this line then no problem
so please suggest me an other way to remove an element. thanks in advance.
Dear all,
On each iteration in Vector , i want to deduce one element and delete it. then pass remaining vector to my function.
so, problem is this. it is not erasing the specific vector
Code:
typedef std::vector < int > nodeList;
nodeList temp;
nodeList neighborX = this->computeNeighbors(x);
for (nodeList::iterator iter = neighborX.begin(); iter != neighborX.end(); ++iter)
{
int y = *iter;
temp = neighborX;
neighborX.erase(iter); // deduce first variable as y and delete it from the list.
graph = this->computeIndependence(ds, graph, x, y, neighborX, condVariables, sep);
neighborX = temp;
}
But it is giving an error.
Code:
error: program: c:\.....\....\.....\vector line 117
Expression : ("this->_Mycont != NULL",0)
i tried to find an error but i am fail,
if i remove this line then no problem
Code:
neighborX.erase(iter);
so please suggest me an other way to remove an element. thanks in advance.