Hi,
I'm porting a medium-sized C++ project from Visual Studio 2005 to MacOS, XCode / GCC 4.0.
One of the differences I have just stumbled across has to do with erasing an element from a map. In Visual Studio I could erase an element specified by an iterator and assign the return value to the iterator to get the position of the next element. This way the iterator would not point to some invalid address after erasing.
In other words, in Visual Studio I could do this:
itor=m_ResourceMap.erase(itor);
In GCC 4.0, the erase function returns void, so I can't do that. Does that mean that the following map elements are shifted one backwards, so the iterator points automatically to the next element, or does that mean that I have to increment the iterator afterwards? The online STL Documentation is not very concise on the subject and XCode does not seem to have any.
Thanks for your help,
Adrian