Closed Yoplitein closed 9 years ago
It's kind of funny that worked at all. The point of decrementing there was to continue from the next element after the current one was erased. The next element would be skipped otherwise.
I just did a little research on this too. The erase method invalidates the iterator, so what I would do is increment instead of decrement at the calls to erase. That way we're not using an invalid iterator or doing illegal things. Then to make sure the next element isn't skipped, the it++ on line 1576 should be moved to just after 1709.
It's kind of funny that worked at all.
I've found a few things like that so far. What version of Visual Studio did you use for this?
2012
Excellent. After applying your fix, everything works beautifully on Linux.
Also might have fixed other issues I was running in to on windows, could've been corrupting the memory etc.
Awesome work!
I've begun work on a port to Linux on my fork. Everything seems to work fine, for the most part.
The only issue I've had so far is in model_util.cpp, lines 1613, 1701, and 1707 (in the unported source):
After being yelled at by my compiler, and doing a little research, I've discovered that decrementing forward iterators is simply not allowed.
I have no idea what this is supposed to do. Googling only turns up cases where people have used this for reverse iteration, but that doesn't seem to be the case here. What would you suggest as a workaround?