MeMooMeM wrote:
Mathias Gaunard-2 wrote:
You should write a proper testcase and provide your platform, so that people have a chance to reproduce your results.
That's right. I prepared a toy code as you suggested, but it works just fine (?!). When I use the same structure inside my code, it segfaults. It is most probably due to some messed up memory section. Still it is strange that I get no segfaults (also no detected errors by valgrind) using STL's map...
Everyone, please ignore this post until I find a proper way to demonstrate the problem.
Thanks!
OK, mystery is solved. Here's what happened, in case someone else has this problem: I was *not* using the standard for loop, as in: for (Map_t::iterator it = somemap.begin(); it != somemap.end(); it++) because I was erasing elements from the map, which is known to mess things up if a for loop is being used. Instead, I was using a while loop and incrementing the iterator in a more controlled way: somemap.erase(it++); which erases the element but still returns correclty incremented iterator. However forgot to check for the case: (it++ == somemap.end()) in the while loop, hence the segmentation faults. Thanks again! -- View this message in context: http://www.nabble.com/Unordered-map-copy-segfaults%21-%28STL-map-does-not%29... Sent from the Boost - Users mailing list archive at Nabble.com.