Hi J-S,
On 10.06.2009 16:23 Uhr, Jean-Sébastien Guay wrote:
But...
I don't believe this is the problem. The 'it = container.erase(it)' construct is
correct.
It seems that according to the standard, it is, but some (many?) versions of
gcc don't
support it (perhaps it was added late in the standardization process or
whatever). I've
run across the same problem as Wang Rui - map::erase(iterator) returns void on
some
common compilers. So it's not portable code (by gcc's fault but still...).
It seems that std::map::erase doesn't actually return an iterator at all, at
least
according to http://www.cplusplus.com/reference/stl/map/erase/
I'm not across any of that code but in my experience it can be dangerous to hold on to
iterators for a length of time since they may become invalid with insert/erase. This
shouldn't be the case for maps though...
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org