Here's a question, will this code compile? (assume someSet is a std::set
std::set ::iterator foo = someSet.erase(512);
This comes from a conversation on #gamedev where it worked with visual studio but was choking on gcc.
Initially I suggested that std::set might not have any erase members that returned anything - though that was wrong as it appears that there is almost definitely one that returns a size_type).
The consensus was that since MSDN's page suggests it returns an iterator or size_type, that is the standard behavior. The belief was that the erase functions listed at the SGI page for std::set, none of which return an iterator, was not standard. A further link to the GNU libstdc++ docs resulted in suspicion that gcc might be in the wrong here - and this was from people whose programming abilities I highly respect.
The beautiful thing is that since I don't have a copy of the standard nearby I have no idea which is correct. Google gave me this mailing list thread which suggests that the STL version of set had an erase member which returned an iterator, but standard C++ doesn't. Also, the freely available draft standard suggests in section 23.3.3 that it doesn't return an iterator.
Until I have a copy of the standard in front of me I can either trust what MSDN and some of the more competent members of gamedev have to say, or I can hope that some page I found on google and a draft version of the standard is correct, yuck.
Admittedly this might not seem like a big deal, and if you were only using Visual Studio as a build environment it wouldn't be a problem - but personally I think its symptomatic of some of the larger problems with C++.