Hi, On 14 February 2011 21:05, Michael Meeks <michael.me...@novell.com> wrote:
> I wonder if the stlport iterators were simply more robust against > changes in the underlying structures. Is this a list it is iterating or > a hash ? If the latter then changes in the 'hash' had undefined (but > non-crashy) behaviour with stlport. I remember writing some code a number of years ago that iterated over a map and deleted 'expired' items during iteration. Using libstdc++ on CentOS 4 vintage I definitely had to take a local copy of the iterator, move on to the next item using ++ii, then delete the item using the copy of the iterator (and never use the copy again), otherwise it would crash. The code didn't look as pretty as using a simple for (std::map<string,bar>::iterator ii(foo.begin(); ii!= foo.end(); ++ii) loop, but at least it worked. I think there is no guarantee in STL for certain data types (like maps) when you erase the value at the iterator. I never used the hash - it always seemed to use more memory than maps, and wasn't any faster with what I was trying to do. STLport might be a bit more clever about this kind of (ab)use, or it might just be luck. Regards Steven _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice