Hi,
I've got a section of code that basically goes like so:
int l_Index = 0;
std::set<intl_Set;
while(l_Index < 10)
{
l_Set.insert(l_Index++);
}
This USUALLY works okay (insert() doesn't appear to have
side-effects, so l_Index goes up by one each time), but at some point,
my app gets into a state where, by breaking into it with WinDBG, I can
see that the loop is repeating, but l_Index is not incrementing. I
know the insert() is working because I can step through it AND I can
see that memory is increasing.
QUESTION: Is this code not a good idea? If not, why not? The
easy solution is to move the increment OUT of the insert(), but I want
to be sure that it will solve the problem, since this state is
difficult to reproduce, and just because the new code SEEMS to work
doesn't mean I've solidly removed the problem.
Thanks in advance for any help on this one.
Allan Stirrett.