A
Allerdyce.John
Hi,
I have this piece of code which loops thru a STL list, but that causs
an infinite loop.
bool Executer::group(MyList& bl, ResultList & grl) {
for (ExecuterList::iterator i = _executerList.begin(); i !=
_executerList.end(); i++) {
Executer* bg = (*i);
bg->group(bl, grl);
}
return true;
}
ExecuterList: is a type 'list<Executer*>'
I am able to iterator the loop once (i.e. I did not stuck inside the
group() of the first executer).
and that list only has 1 item, so I should exit the for() loop after
the group() of the executer has returned.
But it does not, it just stuck there and CPU goes up to 100%.
Any idea is appreciated.
I have this piece of code which loops thru a STL list, but that causs
an infinite loop.
bool Executer::group(MyList& bl, ResultList & grl) {
for (ExecuterList::iterator i = _executerList.begin(); i !=
_executerList.end(); i++) {
Executer* bg = (*i);
bg->group(bl, grl);
}
return true;
}
ExecuterList: is a type 'list<Executer*>'
I am able to iterator the loop once (i.e. I did not stuck inside the
group() of the first executer).
and that list only has 1 item, so I should exit the for() loop after
the group() of the executer has returned.
But it does not, it just stuck there and CPU goes up to 100%.
Any idea is appreciated.